Hello,
It is true that you have to avoid the sun as far as possible when you are on accutane. For the melasma, treatment options include treatment with vitamin C and hydrocortisone, peel with carbon dioxide snow and alexandrite and ND-Yag Q-Switched laser treatment preceded by a hydroquinone-based application. But get it done after the course of Accutane. Please discuss these options with your dermatologist.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.
While there is not many reports connecting Accutane and photosensitivity you have done well to use sunscreen.
However many melasmas are relatively resistant to treatment.A little Aloe Vera gel might help as a night application.
Do consult your doc.