This commit is contained in:
2025-10-24 13:43:00 -06:00
parent a2be3ee273
commit 0cdd4e178f
11 changed files with 223 additions and 63 deletions
+4
View File
@@ -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,