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