File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ function getSecret(): Uint8Array {
2929}
3030
3131// Token expiration constants
32- const TOKEN_ONE_HOUR_MS = 60 * 60 * 1000 ; // milliseconds
33- const TOKEN_SEVEN_DAYS_SECONDS = 7 * 24 * 60 * 60 ; // seconds
32+ const TOKEN_ONE_HOUR_MS = 60 * 60 * 1000 ; // 1 hour in ms
33+ const TOKEN_SEVEN_DAYS_SECONDS = 7 * 24 * 60 * 60 ; // 7 days in seconds
3434
3535// Cookie configuration
3636const COOKIE_NAME = "oidc_token" as const ;
@@ -105,7 +105,9 @@ export async function decrypt(jwe: string): Promise<OidcTokenData> {
105105 if ( error instanceof jose . errors . JWEInvalid ) {
106106 throw new Error ( "Invalid JWE format" ) ;
107107 }
108- throw error ;
108+ // Wrap unexpected errors to avoid exposing internal details
109+ const message = error instanceof Error ? error . message : "Unknown error" ;
110+ throw new Error ( `Token decryption error: ${ message } ` ) ;
109111 }
110112}
111113
You can’t perform that action at this time.
0 commit comments