[PR #4219] [MERGED] fix(apple): allow audience to be string | string[] #30860

Closed
opened 2026-04-17 21:52:12 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4219
Author: @EthanShoeDev
Created: 8/25/2025
Status: Merged
Merged: 8/26/2025
Merged by: @himself65

Base: canaryHead: fix/apple-audience-type-string-or-array


📝 Commits (1)

  • 02ab9ae fix(apple): allow audience to be string | string[]

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/social-providers/apple.ts (+1 -1)

📄 Description

This PR widens the TypeScript type for AppleOptions.audience.

At runtime, the implementation already supports passing either a string or a string[] (since jose's jwtVerify accepts both).

However, the current type is only string, which forces developers to use casts (as any or as unknown as string) when supplying multiple values.


Summary by cubic

Widen AppleOptions.audience to accept string or string[] to match runtime behavior. This removes the need for casts when providing multiple audiences.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/4219 **Author:** [@EthanShoeDev](https://github.com/EthanShoeDev) **Created:** 8/25/2025 **Status:** ✅ Merged **Merged:** 8/26/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/apple-audience-type-string-or-array` --- ### 📝 Commits (1) - [`02ab9ae`](https://github.com/better-auth/better-auth/commit/02ab9ae37945b072b49ef6a60c6f750e1c7b2316) fix(apple): allow audience to be string | string[] ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/social-providers/apple.ts` (+1 -1) </details> ### 📄 Description This PR widens the TypeScript type for `AppleOptions.audience`. At runtime, the implementation already supports passing either a `string` or a `string[]` (since `jose`'s `jwtVerify` accepts both). However, the current type is only `string`, which forces developers to use casts (`as any` or `as unknown as string`) when supplying multiple values. ## Related Discussions - Original proposal to allow `string[]`: #3605 - Implementation that landed runtime multi-audience support, but left the type as `string`: #3710 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Widen AppleOptions.audience to accept string or string[] to match runtime behavior. This removes the need for casts when providing multiple audiences. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-17 21:52:12 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#30860