Skip to content

Commit b34d6b8

Browse files
committed
fix: use appId as clientid in upgrade
1 parent 62812b4 commit b34d6b8

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/auth/oauth/strategies/apple.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ async function validateGrantCode(providerSettings, code, redirectUrl) {
9797
form: {
9898
code,
9999
client_id: appId,
100-
client_secret: clientSecret(appId),
100+
client_secret: clientSecret({ withAppId: true }),
101101
grant_type: 'authorization_code',
102102
redirect_uri: redirectUrl,
103103
},
@@ -124,11 +124,15 @@ function getProvider(options, server) {
124124

125125
return {
126126
password,
127-
appId,
128127
clientId,
129128
isSameSite,
130129
cookie,
131-
clientSecret: (cid) => getSecretKey(teamId, cid || clientId, keyId, privateKey),
130+
clientSecret: ({ withAppId = false }) => getSecretKey(
131+
teamId,
132+
withAppId ? appId : clientId,
133+
keyId,
134+
privateKey
135+
),
132136
forceHttps: true,
133137
providerParams: {
134138
response_mode: 'form_post',

test/suites/actions/oauth/upgrade.apple.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const request = require('request-promise');
33
const Users = require('../../../../src');
44

55
// @TODO stub
6-
describe.skip('oauth.upgrade action', function suite() {
6+
describe('oauth.upgrade action', function suite() {
77
const service = new Users({ oauth: { providers: { apple: { enabled: true } } } });
88

99
before(() => service.connect());

0 commit comments

Comments
 (0)