This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpPost("login")] | |
public async Task<IActionResult> Login([FromBody] LoginRquest login) | |
{ | |
try | |
{ | |
var user = await _userService.AuthenticateUser(login); | |
var token = GenerateToken(user); | |
// This is the extra step | |
HttpContext.Response.Cookies.Append("access_token", token, new CookieOptions{HttpOnly = true}); |