Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
 void AddAuthCookieToResponse(SignInViewModel model)
 {
     Response.Cookies.Add(
         CreateAuthCookie(
             model.Username, 
             GetRoles(model.Username)
         )
     );
 }