diff --git a/src/auth/guards/local.strategy.ts b/src/auth/guards/local.strategy.ts index 84d71d7..4325973 100644 --- a/src/auth/guards/local.strategy.ts +++ b/src/auth/guards/local.strategy.ts @@ -14,11 +14,10 @@ export class LocalStrategy extends PassportStrategy(Strategy) { //Login인증용 async validate(email: string, password: string): Promise { - const user = await this.authService.validateUser(email, password) - //console.log(user) - if (!user) { - throw new UnauthorizedException() + try { + return await this.authService.validateUser(email, password) + } catch (e) { + new UnauthorizedException(e.message) } - return user } }