mirror of
https://github.com/Shchoholiev/shopping-assistant-web-client.git
synced 2025-04-05 00:59:38 +00:00
SA-10 authentication fixed
This commit is contained in:
parent
3065eef463
commit
0cf3012e74
@ -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;
|
||||
|
@ -17,7 +17,5 @@ public class IndexModel : PageModel
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
var token = _authenticationService.GetAuthTokenAsync().Result;
|
||||
ViewData["Token"] = token;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user