nestjs_auth...
This commit is contained in:
parent
3d83b897ce
commit
75f6290ead
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user