File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,8 @@ export function IdentityContextProvider({
99
99
/** some people may want to use this as a hook and bring their own contexts */
100
100
export function useNetlifyIdentity (
101
101
url : string ,
102
- onAuthChange : authChangeParam = ( ) => { }
102
+ onAuthChange : authChangeParam = ( ) => { } ,
103
+ enableRunRoutes : boolean = true
103
104
) : ReactNetlifyIdentityAPI {
104
105
const goTrueInstance = new GoTrue ( {
105
106
APIUrl : `${ url } /.netlify/identity` ,
@@ -116,7 +117,9 @@ export function useNetlifyIdentity(
116
117
} ;
117
118
118
119
React . useEffect ( ( ) => {
119
- runRoutes ( goTrueInstance , _setUser ) ;
120
+ if ( enableRunRoutes ) {
121
+ runRoutes ( goTrueInstance , _setUser ) ;
122
+ }
120
123
} , [ ] ) ;
121
124
122
125
/******* OPERATIONS */
You can’t perform that action at this time.
0 commit comments