We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 11b78d1 + 86a10af commit 7798532Copy full SHA for 7798532
src/index.tsx
@@ -99,7 +99,8 @@ export function IdentityContextProvider({
99
/** some people may want to use this as a hook and bring their own contexts */
100
export function useNetlifyIdentity(
101
url: string,
102
- onAuthChange: authChangeParam = () => {}
+ onAuthChange: authChangeParam = () => {},
103
+ enableRunRoutes: boolean = true
104
): ReactNetlifyIdentityAPI {
105
const goTrueInstance = new GoTrue({
106
APIUrl: `${url}/.netlify/identity`,
@@ -116,7 +117,9 @@ export function useNetlifyIdentity(
116
117
};
118
119
React.useEffect(() => {
- runRoutes(goTrueInstance, _setUser);
120
+ if (enableRunRoutes) {
121
+ runRoutes(goTrueInstance, _setUser);
122
+ }
123
}, []);
124
125
/******* OPERATIONS */
0 commit comments