Skip to content

Commit

Permalink
fix: Update Apple provider config (#11453)
Browse files Browse the repository at this point in the history
  • Loading branch information
xixixao authored Aug 8, 2024
1 parent fba3a14 commit 53f8b56
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions packages/core/src/providers/apple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ export interface AppleProfile extends Record<string, any> {
* ],
* })
* ```
*
*
* Apple requires the client secret to be a JWT. You can generate one using the following script:
* https://bal.so/apple-gen-secret
*
* Read more: [Creating the Client Secret
](https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens#3262048)
*
* ### Resources
*
Expand All @@ -140,16 +147,7 @@ export interface AppleProfile extends Record<string, any> {
* we might not pursue a resolution. You can ask for more help in [Discussions](https://authjs.dev/new/github-discussions).
*/
export default function Apple<P extends AppleProfile>(
options: Omit<OAuthUserConfig<P>, "clientSecret"> & {
/**
* Apple requires the client secret to be a JWT. You can generate one using the following script:
* https://bal.so/apple-gen-secret
*
* Read more: [Creating the Client Secret
](https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens#3262048)
*/
clientSecret: string
}
options: OAuthUserConfig<P>,
): OAuthConfig<P> {
return {
id: "apple",
Expand All @@ -159,13 +157,8 @@ export default function Apple<P extends AppleProfile>(
authorization: {
params: { scope: "name email", response_mode: "form_post" },
},
profile(profile) {
return {
id: profile.sub,
name: profile.name,
email: profile.email,
image: null,
}
client: {
token_endpoint_auth_method: "client_secret_post",
},
style: {
text: "#fff",
Expand Down

0 comments on commit 53f8b56

Please sign in to comment.