File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -34,17 +34,21 @@ export const getSession = <Option extends BetterAuthOptions>() =>
34
34
* and fetch the session from the database
35
35
*/
36
36
disableCookieCache : z
37
- . boolean ( {
38
- description :
39
- "Disable cookie cache and fetch session from database" ,
40
- } )
41
- . or ( z . string ( ) . transform ( ( v ) => v === "true" ) )
37
+ . optional (
38
+ z
39
+ . boolean ( {
40
+ description :
41
+ "Disable cookie cache and fetch session from database" ,
42
+ } )
43
+ . or ( z . string ( ) . transform ( ( v ) => v === "true" ) ) ,
44
+ )
42
45
. optional ( ) ,
43
46
disableRefresh : z
44
47
. boolean ( {
45
48
description :
46
49
"Disable session refresh. Useful for checking session status, without updating the session" ,
47
50
} )
51
+ . or ( z . string ( ) . transform ( ( v ) => v === "true" ) )
48
52
. optional ( ) ,
49
53
} ) ,
50
54
) ,
@@ -171,7 +175,6 @@ export const getSession = <Option extends BetterAuthOptions>() =>
171
175
}
172
176
return ctx . json ( null ) ;
173
177
}
174
-
175
178
/**
176
179
* We don't need to update the session if the user doesn't want to be remembered
177
180
* or if the session refresh is disabled
Original file line number Diff line number Diff line change @@ -190,7 +190,6 @@ export const createInternalAdapter = (
190
190
const data : Omit < Session , "id" > = {
191
191
ipAddress : request ? getIp ( request , ctx . options ) || "" : "" ,
192
192
userAgent : headers ?. get ( "user-agent" ) || "" ,
193
- ...rest ,
194
193
/**
195
194
* If the user doesn't want to be remembered
196
195
* set the session to expire in 1 day.
@@ -203,6 +202,7 @@ export const createInternalAdapter = (
203
202
token : generateId ( 32 ) ,
204
203
createdAt : new Date ( ) ,
205
204
updatedAt : new Date ( ) ,
205
+ ...rest ,
206
206
} ;
207
207
const res = await createWithHooks (
208
208
data ,
You can’t perform that action at this time.
0 commit comments