fix: the iPhone app's native sign-in saves its consent, so the API accepts its tokens by gnapse · Pull Request #147 · klipstack/klipstack · GitHub
Skip to content

fix: the iPhone app's native sign-in saves its consent, so the API accepts its tokens - #147

Merged
gnapse merged 2 commits into
mainfrom
fix-app-consent
Oct 20, 2026
Merged

gnapse merged 2 commits into
mainfrom
fix-app-consent

Conversation

@gnapse

@gnapse gnapse commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

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

  • A klipstack-mobile sign-in now saves the app's consent itself, in consentReference, 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.
  • iPhone app: switching from the emailed code back to the password no longer leaves the code's letter spacing on the password field ("P a s s w o r d").
  • Accounts already affected sign in once more after the deploy.

Verification

  • The app sign-in test now calls the API with the new token. It fails without the fix and passes with it.
  • pnpm verify passes.
  • pnpm ci:local passed 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.
  • A fresh reviewer found nothing blocking. Its two small findings are fixed: the scopes are now replaced, not widened, and the resource is read from the consent page's signed query.
  • Not verified on a device yet: the field-spacing fix ships with the next TestFlight build.

gnapse and others added 2 commits October 20, 2026 12:06
…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>
@gnapse
gnapse enabled auto-merge (squash) October 20, 2026 17:39
@gnapse
gnapse merged commit 247b13a into main Oct 20, 2026
10 checks passed
@gnapse
gnapse deleted the fix-app-consent branch October 20, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant