nestjs_auth...

This commit is contained in:
최준흠 2022-09-12 15:08:55 +09:00
parent 3d83b897ce
commit 75f6290ead

View File

@ -1,7 +1,7 @@
/* eslint-disable prettier/prettier */
import { Strategy } from 'passport-local'
import { PassportStrategy } from '@nestjs/passport'
import { Injectable, UnauthorizedException } from '@nestjs/common'
import { Injectable } from '@nestjs/common'
import { AuthService } from '../auth.service'
@Injectable()
@ -14,11 +14,6 @@ export class LocalStrategy extends PassportStrategy(Strategy) {
//Login인증용
async validate(email: string, password: string): Promise<any> {
try {
return await this.authService.validateUser(email, password)
} catch (e) {
console.log(e)
throw new UnauthorizedException(e.message)
}
return await this.authService.validateUser(email, password)
}
}