I have seen this issue in variation. But nothing that I can see to apply to why my code isn’t working. I setup an Provider like this
xport default function App() {
return (
<Auth0Provider
domain='*******.us.auth0.com'
clientId='*******'
authorizationParams={{
redirect_uri: `${window.location.origin}/admin/dashboard`
}}
>
<BrowserRouter>
<Routes>
<Route element={<Layout/>}>
<Route path='/' index={true} element={<UploadForm/>} />
<Route path='/login' element={<Login/>} />
<Route path='/admin' element={<ProtectedRoute/>}>
<Route path='/admin/dashboard' element={<AdminDashboard/>} />
</Route>
</Route>
</Routes>
</BrowserRouter>
</Auth0Provider>
);
}
and I have my protected route looking at isAuthenticated
const ProtectedRoute = () => {
const { isAuthenticated } = useAuth0()
return isAuthenticated ? <Outlet /> : <Navigate to='/login' />
}
I am trying to exclusively use google as a login. I have created credentials in Google for this app. It seems to successfully login but isAuthenticated is always null. I don’t see any type of return in the network tab in devtools(Chrome&Firefox). What am I doing wrong?