public ActionResult SignIn(SignInViewModel model) { // NOTE: The SignInViewModel validation will authenticate the username and password. // This action is only called when model is valid, thanks to RequireValidModelStateFilter. AddAuthCookieToResponse(model); return Redirect(GetSafeReturnUrl(model.ReturnUrl)); }
void AddAuthCookieToResponse(SignInViewModel model) { Response.Cookies.Add( CreateAuthCookie( model.Username, GetRoles(model.Username) ) ); }