Improved & fixed some issues with JWT authentication.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user