add JWT_SECRET fallback, remove env_file from compose
This commit is contained in:
@@ -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' },
|
||||
}),
|
||||
}),
|
||||
|
||||
@@ -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',
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ services:
|
||||
build: ./backend
|
||||
ports:
|
||||
- '3000:3000'
|
||||
env_file: .env
|
||||
|
||||
admin:
|
||||
build: ./admin
|
||||
|
||||
Reference in New Issue
Block a user