nestjs_auth...

This commit is contained in:
최준흠 2022-09-10 19:51:09 +09:00
parent e4074f8c95
commit 3456bec3d4

View File

@ -1,6 +1,7 @@
import { ExtractJwt, Strategy } from 'passport-jwt'
import { PassportStrategy } from '@nestjs/passport'
import { Injectable } from '@nestjs/common'
import { jwtConstants } from './jwt.constants'
@Injectable()
export class JwtStrategy extends PassportStrategy(Strategy) {
@ -8,7 +9,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
super({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
ignoreExpiration: false,
secretOrKey: process.env.JWT_SECRET
secretOrKey: jwtConstants.secret
})
}