diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index aa34a71..6bb38db 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -41,7 +41,7 @@ export class AuthService { async register(data: UserDTO): Promise { const tokens = await this.getTokens(data) - data.refresh_key = tokens['refresh-token'] + data.refresh_token = tokens['refresh_token'] const encryptedPassword = await this.getEcryptedPassword(data.password) data.password = encryptedPassword const user = await this.userService.add(data) @@ -53,7 +53,7 @@ export class AuthService { const tokens = await this.getTokens(user) await this.userService.update({ where: { id: user.id }, - data: { refresh_token: tokens['refresh-token'] } + data: { refresh_token: tokens['refresh_token'] } }) return tokens } @@ -76,6 +76,6 @@ export class AuthService { } ) ]) - return { 'access-token': accessToken, 'refresh-token': refreshToken } + return { access_token: accessToken, refresh_token: refreshToken } } } diff --git a/src/user/dtos/user.dto.ts b/src/user/dtos/user.dto.ts index 359c5be..d1d8e39 100644 --- a/src/user/dtos/user.dto.ts +++ b/src/user/dtos/user.dto.ts @@ -1,11 +1,11 @@ -import { ROLE, User } from '@prisma/client' +import { ROLE } from '@prisma/client' export class UserDTO { email: string password: string name: string role?: ROLE | 'USER' - refresh_key?: string + refresh_token?: string is_done?: boolean | false updatedAt?: Date | null createdAt?: Date