asp.net mvc - SignInManager.PasswordSignInAsync is lying to me -
i've been using code log in:
// // get: /account/login [allowanonymous] public actionresult login(string returnurl) { viewbag.returnurl = returnurl; return view(); } // // post: /account/login [httppost] [allowanonymous] [validateantiforgerytoken] public async task<actionresult> login(loginviewmodel model, string returnurl) { if (!modelstate.isvalid) { return view(model); } // doesn't count login failures towards account lockout // enable password failures trigger account lockout, change shouldlockout: true var result = await signinmanager.passwordsigninasync(model.email, model.password, model.rememberme, shouldlockout: false); switch (result) { case signinstatus.success: return redirecttolocal(returnurl); case signinstatus.lockedout: return view("lockout"); case signinstatus.requiresverification: return redirecttoaction("sendcode", new { returnurl = returnurl, rememberme = model.rememberme }); case signinstatus.failure: default: modelstate.addmodelerror("", account.loginfailure); return view(model); } }
this code came visual studio mvc application template. worked until day when of sudden stopped working. have debugged through code signinmanager.passwordsigninasync
returns success
on following request, not logged in.
updates:
i shelved of pending changes , still cannot log in. 1 working on code. not doing.
further updates:
this code works on coworkers machine. works when post staging server. not work on computer.
the first thing did delete "*.v12.suo" file. didn't work. time first closed solution, deleted file. works. can shrug. frustrating problem. magically works now. hope can provide me more understanding crazy situation.
Comments
Post a Comment