{{ message }}
Repository navigation
feat: native sign-in in the iPhone app: Apple, Google, GitHub, password and emailed code - #146
Merged
Merged
Conversation
…ode, Apple, Google and GitHub Every way in signs in through better-auth in process and answers an authorization code for klipstack-mobile, which skips consent now. Apple's refresh token is kept, encrypted, to revoke Sign in with Apple when the account is deleted or Apple disconnected. /sign-in/social is closed over HTTP. Also replaces the awk command for the .p8 key in the self-hosting docs. Amp-Thread-ID: https://ampcode.com/threads/T-01a15729-a41b-749a-be6e-639752903e39 Co-authored-by: Amp <amp@ampcode.com>
Apple through iOS's sheet, Google and GitHub in a private sheet, password or an emailed code, all ending in klipstack-mobile tokens. Deleting the account asks to confirm it's you on the same screen. Amp-Thread-ID: https://ampcode.com/threads/T-01a15729-a41b-749a-be6e-639752903e39 Co-authored-by: Amp <amp@ampcode.com>
…nt on http From the review: the app's Apple and provider sign-ins refuse to create users whatever SIGNUP_MODE says; consent is skipped only on https, where only our app opens the redirect; a day's cap on emailed codes; Apple's authorization is revoked when it signed no one in; the delete sheet keeps its error. Amp-Thread-ID: https://ampcode.com/threads/T-01a15729-a41b-749a-be6e-639752903e39 Co-authored-by: Amp <amp@ampcode.com>
… one in A consent given in process is saved, so asking on http protected nothing after the first sign-in: the scheme's exposure on http is documented instead. Apple's fresh token is revoked only for no account or one not connected to Apple, not on other link errors. Amp-Thread-ID: https://ampcode.com/threads/T-01a15729-a41b-749a-be6e-639752903e39 Co-authored-by: Amp <amp@ampcode.com>
account.server.ts loads it when deleting, by a relative path: the image check runs the CLI without the server's environment. 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
The iPhone app signed in through the web's pages in a browser sheet, which can't offer Apple, Google or GitHub: a trip to a provider loses the app's request. App Review 4.8 needs Sign in with Apple wherever Google or GitHub is offered, and Apple sign-ins must be revoked when the account is deleted.
What changes
The app has its own sign-in screen with these ways in:
/app/sign-in/<provider>);Each one ends in the usual
klipstack-mobilecode and PKCE, so tokens, refresh, the share extension and the widget are unchanged. Consent is skipped for that client.Deleting the account asks "Confirm it's you" on the same form when the server needs a recent sign-in.
Apple's refresh token is kept, encrypted with
BETTER_AUTH_SECRET, and revoked at Apple when the account is deleted or Apple is disconnected. This is best effort: a failure is logged and the deletion goes on.The app creates no account, in any
SIGNUP_MODE.Emailed codes are hashed and allow 3 tries in 10 minutes. At most 10 can be sent a day per address and 100 per IP.
Self-hosting docs: the
.p8one-line command is nowperlinstead ofawk.Verification
In the simulator (iPhone 17 Pro, iOS 26.3) against the dev server:
klipstack-mobilerefresh tokens.New tests cover
/app/sign-in*, Apple tokens and revocation, and unlinking in Settings. Each new behavior's test was seen failing without it.pnpm verifyandpnpm ci:localpass. In e2e, 305 tests passed and 3 were flaky (feeds, Getting started, highlight resizing) and passed on retry. The image build first failed because the operator CLI now reaches the Apple revocation. It loads that module lazily now, and the image copies it. I checked that the module loads in the image.The review found, and this branch fixes:
Dismissed: the mobile app has no unit tests (CI skips it); revoking happens before the delete transaction (documented, best effort).
Not verified: real Apple, Google and GitHub sign-ins and Apple's revocation (they need a signed build), and the share extension after a native sign-in.
Risk and follow-ups
com.klipstack.mobile. Otherwise it answers "Apple's sign-in couldn't be checked".com.klipstack.app:can get a signed-in Safari reader's code without a prompt. A saved consent allowed this before too; it is documented indocs/security.md.