Introduce Better Auth-based authentication for the Attik mobile app so users can sign in either with email/SMS one-time passwords or with their Google accounts, while leveraging the existing backend user/session models.
The current Expo app hardcodes EMPLOYEE_ID, API_BASE_URL, and API_KEY inside inspector-app/constants/config.ts, which bypasses real authentication flows. Backend routes already manage users (src/models/userSchema.ts), sessions (src/routes/authenticate.ts), and passwordless tokens, but they are coupled to magic-link flows. We want to reuse the same data sources while shifting to Better Auth for session management.
src/lib/auth.ts) using the MongoDB adapter so user data remains in userSchema and sessions in sessionSchema with Redis caching.sendResendTemplate for email delivery and wiring an SMS provider so OTP delivery can be email or text per user choice.trustedOrigins for Expo deep-links and mount the Better Auth handler (either new /api/auth/* route or an extension of routes/authenticate.ts) without breaking existing session consumers.better-auth/react, @better-auth/expo/client) that stores session cookies with expo-secure-store and exposes hooks like useSession for screens.constants/config.ts by deriving IDs, company membership, and API access details from the authenticated session.BETTER_AUTH_SECRET, Google OAuth IDs, SMS credentials, updated Expo scheme) and update Expo/Metro configs as required by the Better Auth Expo integration./authenticate flows. Roll out behind a feature flag before removing the legacy config constants.Please authenticate to join the conversation.
Completed
Main App
5 months ago
Linear
Get notified by email when there are changes.
Completed
Main App
5 months ago
Linear
Get notified by email when there are changes.