File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -151,10 +151,7 @@ export const getGeolocation = (): CloudflareGeolocation | undefined => {
151151 * @param options - The base BetterAuthOptions to be enhanced.
152152 * @returns BetterAuthOptions configured for use with Cloudflare.
153153 */
154- export const withCloudflare = (
155- cloudFlareOptions : WithCloudflareOptions ,
156- options : BetterAuthOptions
157- ) : BetterAuthOptions => {
154+ export const withCloudflare = < T extends BetterAuthOptions > ( cloudFlareOptions : WithCloudflareOptions , options : T ) => {
158155 const autoDetectIpEnabled =
159156 cloudFlareOptions . autoDetectIpAddress === undefined || cloudFlareOptions . autoDetectIpAddress === true ;
160157 const geolocationTrackingForSession =
@@ -194,7 +191,7 @@ export const withCloudflare = (
194191 plugins : [ cloudflare ( cloudFlareOptions ) , ...( options . plugins ?? [ ] ) ] ,
195192 advanced : updatedAdvanced ,
196193 session : updatedSession ,
197- } ;
194+ } as T ;
198195} ;
199196
200197export type SessionWithGeolocation = Session & CloudflareGeolocation ;
You can’t perform that action at this time.
0 commit comments