Пример #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));
        }
Пример #2
0
 void AddAuthCookieToResponse(SignInViewModel model)
 {
     Response.Cookies.Add(
         CreateAuthCookie(
             model.Username, 
             GetRoles(model.Username)
         )
     );
 }