Skip to content

Commit 5931692

Browse files
committed
Turns out you do need to actually ask for the email of the apple user, and I had just not realized this because once a users grants it, even if it's not asked for in scopes in the future, it'll keep sending it
1 parent 9897d6c commit 5931692

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

api/src/OAuthHandler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,14 @@ export class OAuthHandler<
139139
/** class constant: maps the functions to their required HTTP verb for access */
140140
static get VERBS(): Record<OAuthMethodNames, 'GET' | 'POST' | 'DELETE'> {
141141
return {
142-
linkAppleAccount: 'GET',
142+
linkAppleAccount: 'POST',
143143
linkGitHubAccount: 'GET',
144144
linkGoogleAccount: 'GET',
145145
unlinkAccount: 'DELETE',
146-
loginWithApple: 'GET',
146+
loginWithApple: 'POST',
147147
loginWithGitHub: 'GET',
148148
loginWithGoogle: 'GET',
149-
signupWithApple: 'GET',
149+
signupWithApple: 'POST',
150150
signupWithGitHub: 'GET',
151151
signupWithGoogle: 'GET',
152152
getConnectedAccounts: 'GET',

web/src/oauth.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,10 @@ export default class OAuthClient {
168168
switch (provider) {
169169
case 'apple':
170170
/**
171-
* no matter what you put here, you don't get anything back in the initial response, even though
171+
* no matter what you put here, you don't get name back in the initial response, even though
172172
* the apple documentation says it'll send back a 'user' object with the email and name (https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/incorporating_sign_in_with_apple_into_other_platforms/#3332115).
173-
* additionally, no matter what you put here, you still get the email in the ID token.
174173
*/
175-
scope = ''
176-
// scope = 'name email'
174+
scope = 'name email'
177175
break
178176
case 'github':
179177
scope = 'read:user user:email'
@@ -191,8 +189,7 @@ export default class OAuthClient {
191189
switch (provider) {
192190
case 'apple':
193191
clientSpecificOptions = {
194-
response_mode: 'query',
195-
// response_mode: 'form_post',
192+
response_mode: 'form_post',
196193
}
197194
break
198195
case 'github':

0 commit comments

Comments
 (0)