增加站点登录持久化

This commit is contained in:
Argo-MacBookPro 2018-06-08 21:11:40 +08:00
parent 801943d956
commit d875d1bc4d
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ namespace Bootstrap.Admin.Controllers
{
var identity = new ClaimsIdentity(CookieAuthenticationDefaults.AuthenticationScheme);
identity.AddClaim(new Claim(ClaimTypes.Name, userName));
await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(identity));
await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(identity), new AuthenticationProperties() { IsPersistent = remember == "true" });
return Redirect("~/");
}
var mobile = true; //Request.Browser.IsMobileDevice;