[go: up one dir, main page]

Skip to content
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

🗺️ Middleware #7643

Open
ryanflorence opened this issue Oct 11, 2023 · 6 comments
Open

🗺️ Middleware #7643

ryanflorence opened this issue Oct 11, 2023 · 6 comments

Comments

@ryanflorence
Copy link
Member
@knownasilya
Copy link
knownasilya commented Mar 12, 2024

What's the status on this? Specifically asking for ReactRouter because the root loader doesn't run first there and it seems like everyone using ReactRouter (personally as a stepping stone to Remix) is floundering (see remix-run/react-router#9327) on how to do authentication.

@nilansaha
Copy link

Is there any update on this? Authentication is probably the biggest use case.

@chasoft
Copy link
chasoft commented Oct 4, 2024

My approach for this is:

  • using middleware to check for logged-in status and inject it into a context variable.
  • because we need to check authentication for every single loader, I created a Higher-Order Function (HOF) to handle this automatically.

However, I'm unable to find unstable_dataStrategy in version 7.

@infiniteluke
Copy link

@chasoft https://reactrouter.com/en/main/routers/create-browser-router#middleware

@jrmyio
Copy link
jrmyio commented Oct 29, 2024

@chasoft https://reactrouter.com/en/main/routers/create-browser-router#middleware

We do still need a way to be able to change dataStrategy using RR7 vite plugin though.

@chinanderm
Copy link

@infiniteluke Using the new routes.ts pattern, there is nothing similar to RRv6 handle to set up middleware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Planned
Development

No branches or pull requests

8 participants