quavedev / apple-oauth

Sign in with Apple OAuth2 handler for Meteor.
MIT License
3 stars 15 forks source link

Unable to parse state from OAuth query #11

Closed jakecarlson closed 3 years ago

jakecarlson commented 3 years ago

I'm having an issue getting Apple sign up / sign to work on iOS. I recently upgraded to Meteor 2.0. I am using the following packages:

quave:accounts-apple@1.1.5 quave:apple-oauth@1.4.4

Clicking on the Apple sign in button produces this error on the server:

{"line":"76","file":"oauth_server.js","message":"Unable to parse state from OAuth query: ","time":{"$date":1613866887892},"level":"warn"}
Exception while invoking method 'login' SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Object.OAuth._stateFromQuery (packages/oauth/oauth_server.js:74:17)
at getTokens (packages/quave:apple-oauth/apple_server.js:183:23)
at MethodInvocation.<anonymous> (packages/quave:apple-oauth/apple_server.js:257:42)
at packages/accounts-base/accounts_server.js:499:31
at tryLoginMethod (packages/accounts-base/accounts_server.js:1341:14)
at AccountsServer._runLoginHandlers (packages/accounts-base/accounts_server.js:497:22)
at MethodInvocation.methods.login (packages/accounts-base/accounts_server.js:557:31)
at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1771:12)
at packages/ddp-server/livedata_server.js:719:19
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)
at packages/ddp-server/livedata_server.js:717:46
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)
at packages/ddp-server/livedata_server.js:715:46
at new Promise (<anonymous>)
at Session.method (packages/ddp-server/livedata_server.js:689:23)
at packages/ddp-server/livedata_server.js:559:43

Note that this appears to work on the web; it's just iOS where it's failing. The app has the proper "Sign in with Apple" capability in Xcode.

Prior to upgrading Meteor to 2.0, I was on the following versions, and the iOS build worked with Apple sign in:

quave:accounts-apple@1.1.4 quave:apple-oauth@1.4.3

What do you recommend I try as troubleshooting steps?

renanccastro commented 3 years ago

Hello, @jakecarlson thanks for submitting this issue. I've identified the error, and it is related to my previous modification on enabling shards/multiple service ids. I'm working on a fix. I will let you know when it's released. Probably in 1 hour or so.

jakecarlson commented 3 years ago

Thanks @renanccastro, the new versions works a charm!