Skip to content

Commit 2c49090

Browse files
Fix apple auth scope (#950)
* Fix apple auth scope * Fix Apple auth scope test
1 parent e7de3b1 commit 2c49090

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/wallet/wdk/src/sequence/handlers/authcode.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ export class AuthCodeHandler extends IdentityHandler implements Handler {
4545
isSignUp,
4646
})
4747

48+
const scope = this.signupKind === 'apple' ? 'name email' : 'openid profile email'
4849
const searchParams = new URLSearchParams({
4950
client_id: this.audience,
5051
redirect_uri: this.redirectUri,
5152
response_type: 'code',
52-
scope: 'openid profile email',
53+
scope,
5354
state,
5455
})
5556

packages/wallet/wdk/test/authcode.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ describe('AuthCodeHandler', () => {
311311

312312
expect(result).toContain('https://appleid.apple.com/auth/authorize?')
313313
expect(result).toContain('client_id=apple-client-id')
314+
const resultUrl = new URL(result)
315+
expect(resultUrl.searchParams.get('scope')).toBe('name email')
314316
})
315317

316318
it('Should create commitment without signer', async () => {

0 commit comments

Comments
 (0)