Ejemplo n.º 1
0
 public void Login(AuthenticationModel model, bool isPersistent)
 {
     var authTicket = new FormsAuthenticationTicket(
                                                     1,
                                                     model.Name,
                                                     DateTime.Now,
                                                     DateTime.Now.AddMinutes(FormsAuthentication.Timeout.TotalMinutes),
                                                     isPersistent,
                                                     SerializationHelper.Serialize(model)
                                                    );
     HttpContext.Current.Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(authTicket)));
 }
Ejemplo n.º 2
0
 public DashboardController(IAuthenticationService authenticationService)
 {
     _authenticationService = authenticationService;
     authData = _authenticationService.GetAuthData();
 }