Add biometric auth support to the mobile app
Objective
- Enable biometric unlock (Face ID / Touch ID / Android biometrics) for the inspector mobile app, backed by server-side auth support compatible with Better Auth and the Expo client.
- Use inclusive product copy (“biometrics” / device terminology), not Face-ID-only wording, on both platforms.
Background
- Today, inspector sign-in flows through Better Auth on mobile:
authClientinlib/api.tstargets/auth/inspectorwith@better-auth/expo(expoClient,expo-secure-store,attikmobilescheme,authjscookie prefix) and manualsaveSessionCookiefor iOS cookie behavior. - Screens such as
app/(auth)/login.tsxandapp/(auth)/verify-otp.tsxuseauthClient.$fetch/signIn.social— there is no biometric enrollment or unlock path in the scanned mobile tree. - The backend centralizes inspector Better Auth in
src/util/functions/betterAuth/auth.ts(createInspectorAuth,expoplugin,basePath: '/auth/inspector', trusted origins includingattikmobile://), with related endpoints underinspectorAuthEndpoints,login.ts(toNodeHandler/ Better Auth), andsession.ts.
Scope
Attik Backend
- Add or extend Better Auth–compatible endpoints / session flows so mobile can register and verify biometric credentials in a way that fits the existing inspector auth instance (
auth.ts,inspectorAuthEndpoints.ts, and route mounting inlogin.ts). - Persist whatever identifiers or keys the chosen approach requires (exact storage model is a decision for the implementer, aligned with Better Auth + Expo security guidance).
Attik Mobile
- Integrate OS biometric APIs (e.g. Expo Local Authentication or equivalent) with the post-login experience: optional enrollment, re-prompt when returning to the app, and fallback to existing OTP / social login if biometrics fail or are unavailable.
- Keep
lib/api.tssession storage behavior coherent with@better-auth/expoandSecureStore. - Audit user-visible strings in auth-related screens and settings for Face ID-specific copy; replace with biometric-neutral wording where appropriate.
References
- Backend:
attik-backend/src/util/functions/betterAuth/auth.ts,attik-backend/src/util/functions/betterAuth/inspector/inspectorAuthEndpoints.ts,attik-backend/src/routes/login.ts,attik-backend/src/routes/session.ts - Mobile:
attik-mobile/lib/api.ts,attik-mobile/app/(auth)/login.tsx,attik-mobile/app/(auth)/verify-otp.tsx,attik-mobile/package.json(better-auth,@better-auth/expo)
Status: Planned
Log in to comment and vote
No comments yet
Be the first to share your thoughts.