nestjs_auth...
This commit is contained in:
parent
3d83b897ce
commit
75f6290ead
@ -1,7 +1,7 @@
|
|||||||
/* eslint-disable prettier/prettier */
|
/* eslint-disable prettier/prettier */
|
||||||
import { Strategy } from 'passport-local'
|
import { Strategy } from 'passport-local'
|
||||||
import { PassportStrategy } from '@nestjs/passport'
|
import { PassportStrategy } from '@nestjs/passport'
|
||||||
import { Injectable, UnauthorizedException } from '@nestjs/common'
|
import { Injectable } from '@nestjs/common'
|
||||||
import { AuthService } from '../auth.service'
|
import { AuthService } from '../auth.service'
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -14,11 +14,6 @@ export class LocalStrategy extends PassportStrategy(Strategy) {
|
|||||||
|
|
||||||
//Login인증용
|
//Login인증용
|
||||||
async validate(email: string, password: string): Promise<any> {
|
async validate(email: string, password: string): Promise<any> {
|
||||||
try {
|
return await this.authService.validateUser(email, password)
|
||||||
return await this.authService.validateUser(email, password)
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e)
|
|
||||||
throw new UnauthorizedException(e.message)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user