SA-10 authentication fixed

This commit is contained in:
Mykhailo 2023-09-26 21:07:33 +03:00
parent 3065eef463
commit 0cf3012e74
2 changed files with 0 additions and 5 deletions

View File

@ -183,9 +183,6 @@ public class AuthenticationService
var jsonResponse = JsonConvert.SerializeObject(response.Data.refreshUserToken);
var tokens = JsonConvert.DeserializeObject<TokensModel>(jsonResponse);
_httpContext.Response.Cookies.Append("accessToken", tokens.AccessToken, new CookieOptions { Expires = DateTime.UtcNow.AddDays(180) });
var newRefreshToken = new Cookie("refreshToken", tokens.RefreshToken);
newRefreshToken.Expires = DateTime.UtcNow.AddDays(180);
_httpContext.Request.Head
_httpContext.Response.Cookies.Append("refreshToken", tokens.RefreshToken, new CookieOptions { Expires = DateTime.UtcNow.AddDays(180) });
return tokens.AccessToken;

View File

@ -17,7 +17,5 @@ public class IndexModel : PageModel
public void OnGet()
{
var token = _authenticationService.GetAuthTokenAsync().Result;
ViewData["Token"] = token;
}
}