+ Start a Discussion

How to login to Community through Apex Code and Then Get the landing Page URL

Hello ,

I want to login to community through apex code which will be called from an vf email template. I don't want to redirect the user, i want the next url(Change Password in my case).
Is it possible to login a user as when i am trying to do so using Site.login('username','password',null) i am getting PageReference as null.

PrasanntaPrasannta (Salesforce Developers) 

Please refer to the link below to know on how to login to community through apex code-

Hope this information helps.
It seem this is how it works with Developer Console while Testing.
I had some work around and i am closing this Topic Now.