Don't worry . You must have developed an intraocular inflammation
, and being treated for it.
One eye drop
which you must be using will cause the pupils to dilate, causing discomfort while seeing the sun, but helps the inflammation to regress faster and reduces your pain. Once you stop the drops after your doctors review, you will be alright. Until then sunglasses is the only option.
Please confirm it with your eye specialist and hope you get better soon.