add JWT_SECRET fallback, remove env_file from compose

This commit is contained in:
Lizandro Guarnizo
2026-06-03 23:04:01 -05:00
parent 83508a22f3
commit 25c04ced2f
3 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ import { JwtStrategy } from './jwt.strategy';
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (config: ConfigService) => ({
secret: config.get<string>('JWT_SECRET'),
secret: config.get<string>('JWT_SECRET') || 'dev-secret',
signOptions: { expiresIn: '7d' },
}),
}),
+1 -1
View File
@@ -13,7 +13,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
super({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
ignoreExpiration: false,
secretOrKey: config.get<string>('JWT_SECRET')!,
secretOrKey: config.get<string>('JWT_SECRET') || 'dev-secret',
});
}