Skip to content

Commit 2dd005f

Browse files
committed
fix: update MFA step-up max age configuration
- Increased the default maximum age for MFA step-up from 5 minutes to 15 minutes for improved user experience. - Adjusted the MfaGuard to retrieve the updated configuration value, ensuring consistent enforcement of the new max age setting.
1 parent fb89b45 commit 2dd005f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

apps/api/src/_common/guards/mfa.guard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class MfaGuard implements CanActivate {
2020
const request = context.switchToHttp().getRequest<{ user?: { mfaVerified?: boolean; mfaVerifiedAt?: number | null } }>();
2121
if (!request?.user?.mfaVerified) throw new ForbiddenException('MFA required');
2222

23-
const maxAgeSeconds = this.config.get<number>('application.mfaStepUpMaxAgeSeconds', 5 * 60);
23+
const maxAgeSeconds = this.config.get<number>('application.mfaStepUpMaxAgeSeconds');
2424
const maxAgeMs = Math.max(0, maxAgeSeconds) * 1000;
2525
if (maxAgeMs <= 0) return true;
2626

apps/api/src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ export default (): ConfigInstance => ({
320320
key: process.env['SESAME_HTTPS_PATH_KEY'] || '',
321321
cert: process.env['SESAME_HTTPS_PATH_CERT'] || '',
322322
},
323-
mfaStepUpMaxAgeSeconds: parseInt(process.env['SESAME_MFA_STEPUP_MAX_AGE_SECONDS'] || `${5 * 60}`, 10),
323+
mfaStepUpMaxAgeSeconds: parseInt(process.env['SESAME_MFA_STEPUP_MAX_AGE_SECONDS'] || `${15 * 60}`, 10),
324324
},
325325
helmet: {
326326
contentSecurityPolicy: {

0 commit comments

Comments
 (0)