nestjs_auth...
This commit is contained in:
parent
8a170ec303
commit
c21837ada5
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user