-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
Improve authorization middleware #3048
Improve authorization middleware #3048
Conversation
if ( | ||
(!project.options.dev || isPageRequest) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In dev mode it only redirects pages so that the user in preview sees the same behavior there will be in production. Can't hide RPC requests behind authentication in dev mode for example, as the editor needs to make them.
Looks good. Annoying that we have a parallel dev and prod implementation. A more ideal implementation would be one single function which switches on/off certain middleware based on a |
Improve authorization middleware to cover everything under
/prod
except static files and Toolpad dev server.This way, the same middleware can be used to redirect to sign in and protect the RPC, among other things.