Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat: fix typing errors

Nevo David84aeb318b8c3
diff --git a/apps/backend/src/services/auth/providers/apple.provider.ts b/apps/backend/src/services/auth/providers/apple.provider.ts
index a094deac4..c035b9172 100644
--- a/apps/backend/src/services/auth/providers/apple.provider.ts
+++ b/apps/backend/src/services/auth/providers/apple.provider.ts
@@ -116,6 +116,12 @@ export class AppleProvider extends AuthProviderAbstract {
throw new Error('Invalid provider token');
}
+ // native tokens carry the app bundle id as audience instead of the
+ // web services id
+ const audience: [string, ...string[]] = process.env.APPLE_APP_BUNDLE_ID
+ ? [clientId, process.env.APPLE_APP_BUNDLE_ID]
+ : [clientId];
+
// the id_token must be verified against Apple's public keys because it is
// sent back from the client as the providerToken during registration
const payload = verify(
@@ -123,14 +129,10 @@ export class AppleProvider extends AuthProviderAbstract {
createPublicKey({ key, format: 'jwk' }),
{
algorithms: ['RS256'],
- // native tokens carry the app bundle id as audience instead of the
- // web services id
- audience: [clientId, process.env.APPLE_APP_BUNDLE_ID].filter(
- Boolean
- ) as string[],
+ audience,
issuer: 'https://appleid.apple.com',
}
- ) as { sub: string; email: string };
+ ) as unknown as { sub: string; email: string };
return {
id: payload.sub,