You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears there may be some interference between my oidc-react AuthProvider and the use of the new route loader with react-router v.6.
To provide context, the loader provides data to the route element before it renders.
My AuthProvider works completely fine, redirecting to login, when i do not use the loader. But when I do use a loader (for example fetching data for my homepage), then no redirect to login occurs and my app of course fails to get the necessary credentials to render the homepage.
I'm wondering if anyone else has had this experience and what solution could be. Thanks.
Here's an abbreviated version of my code
App.js
`const router = createBrowserRouter([
{
id: "root",
path: "/",
errorElement: <FullPageError />,
element: <Authentication />, // < -- this is just my <AuthProvider /> and all the necessary config props.
children: [
{
element: <LayoutWithProps />,
children: [
{
index: true,
element: <Applications />,
loader: getApplications, // <-- this is the line that messes things up. However it works great if i have an active session.
}
],
},
],
},
]);
function App() {
return <RouterProvider router={router} />;
}
`
The text was updated successfully, but these errors were encountered:
It appears there may be some interference between my oidc-react AuthProvider and the use of the new route loader with react-router v.6.
To provide context, the loader provides data to the route element before it renders.
My AuthProvider works completely fine, redirecting to login, when i do not use the loader. But when I do use a loader (for example fetching data for my homepage), then no redirect to login occurs and my app of course fails to get the necessary credentials to render the homepage.
I'm wondering if anyone else has had this experience and what solution could be. Thanks.
Here's an abbreviated version of my code
App.js
The text was updated successfully, but these errors were encountered: