fix(oidc): handle literal \n in PEM key from .env files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-04-12 11:54:24 -04:00
parent 086ac02205
commit f06852dd3b
1 changed files with 1 additions and 0 deletions

View File

@ -6658,6 +6658,7 @@ async function initOidcKeys() {
const pemBody = pemEnv
.replace(/-----BEGIN PRIVATE KEY-----/, '')
.replace(/-----END PRIVATE KEY-----/, '')
.replace(/\\n/g, '') // literal \n from .env files
.replace(/\s/g, '');
const binaryDer = Uint8Array.from(atob(pemBody), c => c.charCodeAt(0));
oidcPrivateKey = await crypto.subtle.importKey(