nestjs_auth...

This commit is contained in:
최준흠 2022-09-12 14:51:56 +09:00
parent 8a170ec303
commit c21837ada5

View File

@ -14,11 +14,10 @@ export class LocalStrategy extends PassportStrategy(Strategy) {
//Login인증용
async validate(email: string, password: string): Promise<any> {
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
}
}