Add better-auth Expo plugin for mobile app authentication.

Enable session-based auth from the Expo companion app via SecureStore cookies and trusted deep-link origins.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-17 15:56:53 -04:00
co-authored by Cursor
parent 190fbd433b
commit 81a0ce33a4
3 changed files with 19 additions and 1 deletions
+4
View File
@@ -1,3 +1,4 @@
import { expo } from "@better-auth/expo";
import { betterAuth } from "better-auth";
import { drizzleAdapter } from "better-auth/adapters/drizzle";
import { nextCookies } from "better-auth/next-js";
@@ -31,6 +32,8 @@ export const auth = betterAuth({
}),
trustedOrigins: [
"https://beenvoice.soconnor.dev",
"beenvoice://",
"exp://",
...(authentikOrigin ? [authentikOrigin] : []),
...(process.env.AUTHENTIK_ORIGIN ? [process.env.AUTHENTIK_ORIGIN] : []),
],
@@ -55,6 +58,7 @@ export const auth = betterAuth({
},
},
plugins: [
expo(),
nextCookies(),
...(authentikEnabled
? [