Improved & fixed some issues with JWT authentication.

This commit is contained in:
Tom
2025-02-12 17:21:48 +00:00
parent d907f425dc
commit a0909bfd21
14 changed files with 140 additions and 85 deletions

View File

@ -13,7 +13,7 @@ export class AuthService {
) { }
async login(user: UserEntity) {
async login(user: UserEntity): Promise<AuthenticationDto> {
return this.renew(user, null);
}
@ -27,7 +27,7 @@ export class AuthService {
async renew(
user: UserEntity,
refresh_token: string
): Promise<{ access_token: string, exp: number, refresh_token: string, refresh_exp: number }> {
): Promise<AuthenticationDto> {
const new_refresh_data = await this.refreshTokens.generate(user, refresh_token);
const new_refresh_token = new_refresh_data.refresh_token;
const new_refresh_exp = new_refresh_data.exp;