better error handling?
All checks were successful
Deploy to Server / deploy (push) Successful in 28s

This commit is contained in:
2026-04-10 01:11:14 -05:00
parent 25fcaec204
commit bff7c9971f

View File

@@ -31,7 +31,13 @@ async function generateAppleClientSecret(): Promise<string> {
// Resolve relative to the server/ directory (where the process runs from). // Resolve relative to the server/ directory (where the process runs from).
const absolutePath = resolve(process.cwd(), keyPath); const absolutePath = resolve(process.cwd(), keyPath);
const pem = readFileSync(absolutePath, 'utf8'); let pem: string;
try {
pem = readFileSync(absolutePath, 'utf8');
} catch {
console.warn(`[auth] Apple private key not found at ${absolutePath}. Web Sign in with Apple disabled.`);
return '';
}
const privateKey = await importPKCS8(pem, 'ES256'); const privateKey = await importPKCS8(pem, 'ES256');
return await new SignJWT({}) return await new SignJWT({})