Skip to content

[FEATURE] Build an app to try out Auth0 #7

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

Merged
merged 14 commits into from
Jun 15, 2024
Merged

Conversation

1Copenut
Copy link
Owner

PR closes #2

@1Copenut 1Copenut self-assigned this Jun 15, 2024
Copy link
Owner Author

@1Copenut 1Copenut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Job well done.


const Root = () => {
return (
<Auth0ProviderWithNavigate>
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the most important consideration, right here. We have to wrap the Auth0 context provider around the main <Outlet /> where pages are rendered in the router and write the router in a very prescriptive way.

Make sure to add the TODO to the README because there will be a lot of backtracking in the future if you don't.

};

if (!(domain && clientId && redirectUri)) {
console.log("Nice goin' Ace");
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed for a production app but was helpful when debugging why I was seeing just a blank screen.


export const router = createBrowserRouter(
createRoutesFromElements(
<Route path="/" element={<Root />}>
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is critical for the Auth0 context provider to work correctly. It's wrapped around the <Outlet /> in the Root.tsx file so we can have a one-line router in the index.tsx file.

@1Copenut 1Copenut merged commit a7dc31c into main Jun 15, 2024
2 checks passed
@1Copenut 1Copenut deleted the feature/auth0-react-ts branch June 15, 2024 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Rebuild the Auth0 app using Vite and TypeScript
1 participant