changes
This commit is contained in:
@@ -2,7 +2,11 @@ import { PassportStrategy } from "@nestjs/passport";
|
||||
import{ExtractJwt,Strategy} from 'passport-jwt'
|
||||
|
||||
export class JwtStrategy extends PassportStrategy(Strategy){
|
||||
|
||||
constructor(){
|
||||
if( !process.env.JWT ){
|
||||
throw new Error('JWT_SECRET no está definido en las variables de entorno');
|
||||
}
|
||||
super({
|
||||
jwtFromRequest:ExtractJwt.fromAuthHeaderAsBearerToken(),
|
||||
ignoreExpiration:false,
|
||||
|
||||
Reference in New Issue
Block a user