@@ -14,7 +14,6 @@ import getLogger from '../utils/logger.js';
1414import { sendBootstrapEmail } from './messagingService.js' ;
1515
1616const logger = getLogger ( 'adminBootstrapService' ) ;
17- const DEFAULT_BOOTSTRAP_TTL_MINUTES = 15 ;
1817
1918export class BootstrapError extends Error {
2019 code : string ;
@@ -27,11 +26,6 @@ export class BootstrapError extends Error {
2726 }
2827}
2928
30- function getBootstrapTtlMinutes ( ) : number {
31- const raw = Number ( process . env . SEAMLESS_BOOTSTRAP_TTL_MINUTES ?? DEFAULT_BOOTSTRAP_TTL_MINUTES ) ;
32- return Number . isFinite ( raw ) && raw > 0 ? raw : DEFAULT_BOOTSTRAP_TTL_MINUTES ;
33- }
34-
3529export function isBootstrapEnabled ( ) : boolean {
3630 return process . env . SEAMLESS_BOOTSTRAP_ENABLED === 'true' ;
3731}
@@ -50,6 +44,7 @@ export function getBootstrapSecret(): string {
5044
5145export function assertBootstrapSecret ( provided : string | undefined ) : void {
5246 if ( ! provided ) {
47+ logger . error ( 'Nothing provided for bootstrap secret' ) ;
5348 throw new BootstrapError ( 'BOOTSTRAP_UNAUTHORIZED' , 'Unauthorized.' , 401 ) ;
5449 }
5550
@@ -62,6 +57,7 @@ export function assertBootstrapSecret(provided: string | undefined): void {
6257 providedBuf . length !== expectedBuf . length ||
6358 ! crypto . timingSafeEqual ( providedBuf , expectedBuf )
6459 ) {
60+ logger . error ( 'Incorrect bootstrap secret' ) ;
6561 throw new BootstrapError ( 'BOOTSTRAP_UNAUTHORIZED' , 'Unauthorized.' , 401 ) ;
6662 }
6763}
@@ -120,9 +116,7 @@ export async function createAdminBootstrapInvite(params: {
120116
121117 const rawToken = generateRawToken ( ) ;
122118 const tokenHash = hashToken ( rawToken ) ;
123-
124- const ttlMinutes = getBootstrapTtlMinutes ( ) ;
125- const expiresAt = new Date ( Date . now ( ) + ttlMinutes * 60 * 1000 ) ;
119+ const expiresAt = new Date ( Date . now ( ) + 15 * 60 * 1000 ) ;
126120
127121 await BootstrapInvite . create ( {
128122 email : params . email . toLowerCase ( ) ,
0 commit comments