Handle magic-link sign-in via universal links / app links - #52
Merged
Conversation
Tapping a magic-link email (https://reflectionsprojections.org/auth/mobile/login?token=...) should open the app and sign the user in. This adds the app half of that: - iOS: associatedDomains entitlement for applinks:reflectionsprojections.org (app.config.js + checked-in entitlements file) - Android: autoVerify https intent filter for the /auth/mobile/login path (app.config.js + checked-in AndroidManifest.xml) - app/auth/mobile/login.tsx: expo-router route matching the link path; posts the token to /auth/magic-links/verify with client mobile, stores the JWT, and routes to the tabs (or back to sign-in on failure) - Email-entry screen to request a link (POST /auth/magic-links) plus a link to it from the sign-in screen - Typed API routes for /auth/magic-links and /auth/magic-links/verify The server half (apple-app-site-association / assetlinks.json on reflectionsprojections.org) ships from rp-web. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Patle1234
approved these changes
Aug 7, 2026
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.
Summary
Tapping a magic-link email (
https://reflectionsprojections.org/auth/mobile/login?token=…) should open rp-mobile and sign the user in. The server half — serving.well-known/apple-app-site-associationand.well-known/assetlinks.jsonon the domain — ships from rp-web (ReflectionsProjections/rp-web#134; assetlinks is already live). This PR adds everything on the app side, for both iOS and Android.Changes
Domain association (both platforms)
associatedDomains: ['applinks:reflectionsprojections.org']inapp.config.jsandcom.apple.developer.associated-domainsin the checked-in entitlements file.autoVerifyhttps intent filter for hostreflectionsprojections.org, path prefix/auth/mobile/login, inapp.config.jsand the checked-inAndroidManifest.xml(kept in sync since the native projects are committed).Link handling
app/auth/mobile/login.tsx: expo-router route matching the link's path. Readstoken, posts/auth/magic-links/verifywithclient: 'mobile', stores the JWT in SecureStore, checks/auth/inforoles and routes to home — mirroring the existing Google sign-in flow. Invalid/expired tokens alert and return to sign-in.Requesting a link
(auth)/email-sign-inscreen: email input →POST /auth/magic-links(client: 'mobile'", intent: 'login') → "check your email" state. Linked from the sign-in screen. Copy doesn't disclose whether an account exists (API returns 202 either way; mobile links require an existing USER role).APIRoutesentries for both magic-link endpoints.Testing
npx tsc --noEmit: only the two pre-existing errors on main (tabsscrollRef,shiftsSlice); no new errors.npx eslinton changed screens: no errors (2 pre-existing warnings insign-in.tsx).adb shell pm get-app-links com.reflectionsprojectionsshould show the domainverified; on iOS, long-press the link → "Open in rp-mobile".Deployment notes
assetlinks.jsonis already live with the release-cert fingerprint; verification happens at install/update.🤖 Generated with Claude Code