@@ -2,6 +2,7 @@ import { betterAuth } from 'better-auth';
2
2
import { prismaAdapter } from 'better-auth/adapters/prisma' ;
3
3
import { admin , emailOTP , openAPI } from 'better-auth/plugins' ;
4
4
import { match } from 'ts-pattern' ;
5
+ import { expo } from '@better-auth/expo' ;
5
6
6
7
import {
7
8
AUTH_EMAIL_OTP_EXPIRATION_IN_MINUTES ,
@@ -17,13 +18,15 @@ import { permissions } from '@/features/auth/permissions';
17
18
import { db } from '@/server/db' ;
18
19
import { sendEmail } from '@/server/email' ;
19
20
import { getUserLanguage } from '@/server/utils' ;
21
+ import { inferAdditionalFields } from 'better-auth/client/plugins' ;
20
22
21
23
export type Auth = typeof auth ;
22
24
export const auth = betterAuth ( {
23
25
session : {
24
26
expiresIn : envServer . SESSION_EXPIRATION_IN_SECONDS ,
25
27
updateAge : envServer . SESSION_UPDATE_AGE_IN_SECONDS ,
26
28
} ,
29
+ trustedOrigins : [ 'start-ui-native://' , 'start-ui-native://*' ] ,
27
30
database : prismaAdapter ( db , {
28
31
provider : 'postgresql' ,
29
32
} ) ,
@@ -46,7 +49,9 @@ export const auth = betterAuth({
46
49
disableImplicitSignUp : ! AUTH_SIGNUP_ENABLED ,
47
50
} ,
48
51
} ,
52
+
49
53
plugins : [
54
+ expo ( ) ,
50
55
openAPI ( {
51
56
disableDefaultReference : true , // Use custom exposition in /routes/api/openapi folder
52
57
} ) ,
0 commit comments