{{ message }}
Repository navigation
fix: the iPhone app's native sign-in saves its consent, so the API accepts its tokens - #147
Merged
Merged
Conversation
…ld loses the code's spacing With consent skipped, no consent row was saved, so the API answered "The user disconnected this app" for accounts that never saw the consent page. The code and password fields get their own keys. Amp-Thread-ID: https://ampcode.com/threads/T-01a15729-a41b-749a-be6e-639752903e39 Co-authored-by: Amp <amp@ampcode.com>
…age's resource Amp-Thread-ID: https://ampcode.com/threads/T-01a15729-a41b-749a-be6e-639752903e39 Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
After #146, an account that never clicked "Allow" on the old consent page got "The user disconnected this app" from the API as soon as it signed in to the iPhone app. Accounts created with Apple, Google or GitHub on the web hit it first. The app skips consent, so better-auth saved no consent record, and the API requires one.
What changes
klipstack-mobilesign-in now saves the app's consent itself, inconsentReference, with the scopes and resource of that sign-in. The API accepts its tokens, and Settings lists the app so it can be disconnected. Each sign-in replaces the earlier scopes, as the consent page does.Verification
pnpm verifypasses.pnpm ci:localpassed everything except one browser test, "feeds are off for a new account…". It also flaked in the previous run and passed on GitHub then. Run alone on this branch it passed 3 out of 3. It is unrelated to this change.