Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix: filter auth email verification for mobile (#11430)

Rdmclin2cd18ea36cc22
diff --git a/src/libs/better-auth/define-config.ts b/src/libs/better-auth/define-config.ts
index f755053cbb7..20a16094269 100644
--- a/src/libs/better-auth/define-config.ts
+++ b/src/libs/better-auth/define-config.ts
@@ -122,7 +122,13 @@ export function defineConfig(customOptions: CustomBetterAuthOptions) {
emailVerification: {
autoSignInAfterVerification: true,
expiresIn: VERIFICATION_LINK_EXPIRES_IN,
- sendVerificationEmail: async ({ user, url }) => {
+ sendVerificationEmail: async ({ user, url }, request) => {
+ // Skip sending verification link email for mobile clients (Expo/React Native)
+ // Mobile clients use OTP verification instead, triggered manually via emailOTP plugin
+ if (request?.headers?.get?.('x-client-type') === 'mobile') {
+ return;
+ }
+
const template = getVerificationEmailTemplate({
expiresInSeconds: VERIFICATION_LINK_EXPIRES_IN,
url,