Skip to content

Commit 7798532

Browse files
authored
Merge pull request #14 from YChebotaev/master
Add flag enableRunRoutes
2 parents 11b78d1 + 86a10af commit 7798532

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/index.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ export function IdentityContextProvider({
9999
/** some people may want to use this as a hook and bring their own contexts */
100100
export function useNetlifyIdentity(
101101
url: string,
102-
onAuthChange: authChangeParam = () => {}
102+
onAuthChange: authChangeParam = () => {},
103+
enableRunRoutes: boolean = true
103104
): ReactNetlifyIdentityAPI {
104105
const goTrueInstance = new GoTrue({
105106
APIUrl: `${url}/.netlify/identity`,
@@ -116,7 +117,9 @@ export function useNetlifyIdentity(
116117
};
117118

118119
React.useEffect(() => {
119-
runRoutes(goTrueInstance, _setUser);
120+
if (enableRunRoutes) {
121+
runRoutes(goTrueInstance, _setUser);
122+
}
120123
}, []);
121124

122125
/******* OPERATIONS */

0 commit comments

Comments
 (0)