Hi All,
I'm sending a user a link that works one time that allows them to log into the site. Once they click the link, and I validate it's good, I use the following code:
var account = new AccountController(); var response = account.SignInManager.PasswordSignIn(current.MyUser.Email, current.MyUser.PasswordHash, true, false);
When I debug on response, it is showing success - but immediately after I step over I get this error:
Server Error in '/' Application. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: Line 33: get Line 34: { Line 35: return _signInManager ?? HttpContext.GetOwinContext().Get<ApplicationSignInManager>(); Line 36: } Line 37: private set [NullReferenceException: Object reference not set to an instance of an object.] System.Web.HttpContextBaseExtensions.GetOwinEnvironment(HttpContextBase context) +3 System.Web.HttpContextBaseExtensions.GetOwinContext(HttpContextBase context) +10
I'm not sure why this happens, can anyone please help out? Thank you!