fix(auth): add reliable fallback for JWT secrets to prevent login signing crashes in production
Deploy Canina / deploy (push) Has been cancelled
Deploy Canina / deploy (push) Has been cancelled
This commit is contained in:
1 parent
f1b77f3fba
commit
9b7a9e363d
3 files changed
+20
-28
No files matched your search
@@ -6,12 +6,17 @@ import { AuthController } from './auth.controller';
|
||||
import { JwtStrategy } from './jwt.strategy';
|
||||
import { UsersModule } from '../users/users.module';
|
||||
|
||||
const JWT_SECRET =
|
||||
process.env.JWT_ACCESS_SECRET ||
|
||||
process.env.JWT_SECRET ||
|
||||
'canina_jwt_fallback_secret_32_characters_minimum_len_2026';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
UsersModule,
|
||||
PassportModule,
|
||||
JwtModule.register({
|
||||
secret: process.env.JWT_ACCESS_SECRET,
|
||||
secret: JWT_SECRET,
|
||||
signOptions: { expiresIn: '7d' },
|
||||
}),
|
||||
],
|
||||
@@ -20,3 +25,4 @@ import { UsersModule } from '../users/users.module';
|
||||
exports: [AuthService],
|
||||
})
|
||||
export class AuthModule {}
|
||||
|
||||
Reference in new issue
Block a user