Skip to content

Remove runRoutes #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ export const useIdentityContext = _useIdentityContext; // we dont want to expose
export function IdentityContextProvider({
url,
children,
onAuthChange = () => {},
onAuthChange = () => { },
}: {
url: string;
children: React.ReactNode;
@@ -83,8 +83,8 @@ export function IdentityContextProvider({
// just a safety check in case a JS user tries to skip this
throw new Error(
'invalid netlify instance URL: ' +
url +
'. Please check the docs for proper usage or file an issue.'
url +
'. Please check the docs for proper usage or file an issue.'
);
}
const identity = React.useMemo(() => useNetlifyIdentity(url, onAuthChange), [
@@ -99,7 +99,7 @@ export function IdentityContextProvider({
/** some people may want to use this as a hook and bring their own contexts */
export function useNetlifyIdentity(
url: string,
onAuthChange: authChangeParam = () => {}
onAuthChange: authChangeParam = () => { }
): ReactNetlifyIdentityAPI {
const goTrueInstance = new GoTrue({
APIUrl: `${url}/.netlify/identity`,
@@ -115,10 +115,6 @@ export function useNetlifyIdentity(
return _user; // so that we can continue chaining
};

React.useEffect(() => {
runRoutes(goTrueInstance, _setUser);
}, []);

/******* OPERATIONS */
// make sure the Registration preferences under Identity settings in your Netlify dashboard are set to Open.
// https://react-netlify-identity.netlify.com/login#access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NTY0ODY3MjEsInN1YiI6ImNiZjY5MTZlLTNlZGYtNGFkNS1iOTYzLTQ4ZTY2NDcyMDkxNyIsImVtYWlsIjoic2hhd250aGUxQGdtYWlsLmNvbSIsImFwcF9tZXRhZGF0YSI6eyJwcm92aWRlciI6ImdpdGh1YiJ9LCJ1c2VyX21ldGFkYXRhIjp7ImF2YXRhcl91cmwiOiJodHRwczovL2F2YXRhcnMxLmdpdGh1YnVzZXJjb250ZW50LmNvbS91LzY3NjQ5NTc_dj00IiwiZnVsbF9uYW1lIjoic3d5eCJ9fQ.E8RrnuCcqq-mLi1_Q5WHJ-9THIdQ3ha1mePBKGhudM0&expires_in=3600&refresh_token=OyA_EdRc7WOIVhY7RiRw5w&token_type=bearer
63 changes: 0 additions & 63 deletions src/runRoutes.tsx

This file was deleted.