|
|
|
@ -25,7 +25,7 @@ public class AuthenticationController(IUserService service, IConfiguration confi
|
|
|
|
|
string Password
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
private record AuthenticationResponse(String Token, DateTime ExpirationDate);
|
|
|
|
|
private record AuthenticationResponse(String Token, long ExpirationDate);
|
|
|
|
|
|
|
|
|
|
[HttpPost("/auth/token")]
|
|
|
|
|
public async Task<IActionResult> GenerateToken([FromBody] GenerateTokenRequest req)
|
|
|
|
@ -39,7 +39,7 @@ public class AuthenticationController(IUserService service, IConfiguration confi
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var (jwt, expirationDate) = GenerateJwt(user);
|
|
|
|
|
return Ok(new AuthenticationResponse(jwt, expirationDate));
|
|
|
|
|
return Ok(new AuthenticationResponse(jwt, expirationDate.ToFileTimeUtc()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -73,7 +73,7 @@ public class AuthenticationController(IUserService service, IConfiguration confi
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
var (jwt, expirationDate) = GenerateJwt(user);
|
|
|
|
|
return Ok(new AuthenticationResponse(jwt, expirationDate));
|
|
|
|
|
return Ok(new AuthenticationResponse(jwt, expirationDate.ToFileTimeUtc()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|