@@ -27,7 +27,7 @@ export function useAuth() {
27
27
}
28
28
29
29
export type ConvexAuthClient = {
30
- verbose : boolean | undefined ;
30
+ verbose ? : boolean ;
31
31
logger ?: ConvexReactClient [ "logger" ] ;
32
32
} ;
33
33
@@ -64,7 +64,7 @@ export function AuthProvider({
64
64
const { data : session , isPending : isSessionPending } =
65
65
authClient . useSession ( ) ;
66
66
67
- const verbose : boolean = ( client as any ) . options ? .verbose ?? false ;
67
+ const verbose : boolean = client . verbose ?? false ;
68
68
const logVerbose = useCallback (
69
69
( message : string ) => {
70
70
if ( verbose ) {
@@ -128,17 +128,11 @@ export function AuthProvider({
128
128
( ) => {
129
129
// eslint-disable-next-line @typescript-eslint/no-floating-promises
130
130
( async ( ) => {
131
- // Return early if cross domain plugin is not configured.
132
- // Apparently there's no sane way to do this type check. Only the in
133
- // keyword narrows the type effectively but it doesn't work on functions.
134
- if ( ! ( authClient as any ) [ "crossDomain" ] ) {
135
- return ;
136
- }
137
- const authClientWithCrossDomain =
138
- authClient as AuthClientWithPlugins < PluginsWithCrossDomain > ;
139
- const url = new URL ( window . location . href ) ;
131
+ const url = new URL ( window . location ?. href ) ;
140
132
const token = url . searchParams . get ( "ott" ) ;
141
133
if ( token ) {
134
+ const authClientWithCrossDomain =
135
+ authClient as AuthClientWithPlugins < PluginsWithCrossDomain > ;
142
136
url . searchParams . delete ( "ott" ) ;
143
137
const result =
144
138
await authClientWithCrossDomain . crossDomain . oneTimeToken . verify ( {
0 commit comments