I am having a custom community login page.
The login function is working properly but when i try to reset the password using System.resetPassword(userId , true). I am getting following exception.
System.UnexpectedException: INVALID_SESSION_ID: This session is not valid for use with the API
The context user is the Site guest user.
This is working in Developer Sandbox orgs. But not in full copy sandbox.