diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index 2b149cd..46c1380 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -17,19 +17,19 @@ export class AuthService { ) {} //app.controller.ts에서 @UseGuards(AuthGuard('local'))용 - async validateUser(email: string, password: string): Promise | null { + async validateUser(email: string, password: string): Promise { const user = await this.userService.fetchOne({ email: email }) if (user && user.password === password) { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const { password, ...result } = user // result는 password 를 제외한 user의 모든 정보를 포함한다. //console.log(result) - console.log(password) return result } return null } - async getTokens(user: User): Promise { + getTokens(user: User) { //console.log(user) const access_token_payload = { email: user.email, @@ -51,13 +51,13 @@ export class AuthService { } } - async login(email: string, password: string): Promise | null { + async login(email: string, password: string): Promise { const user = await this.validateUser(email, password) if (!user) return null return await this.getTokens(user) } - async register(data: UserDTO): Promise | null { + async register(data: UserDTO): Promise { const user = await this.userService.add(data) if (!user) return null return await this.getTokens(user)