-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Authorization broken in Razor Pages #7011
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
Comments
I think the right fix for this is that we need to introduce the concept of a dynamic endpoint. This would allow you to run code to replace the This is also really useful for some of the other scenarios that have blocked users from using endpoint routing when they had a custom The Razor pages infrastructure would plug into this feature and use it to compile the page asynchronously, which would return the rich endpoint. |
I've written about this idea before here: #4221 and I think it would solve many of this class of problems. |
@rynowak, do you think your suggested solution is something which can fit in |
Looking at the thread it seems that there's a lot of discussion there and things aren't completely clear yet |
Yes absolutely. |
I’m unclear on why a new feature is required but I’ll talk to @rynowak about it later |
Because we do routing without having compiled the pages. MVC later swaps in the compiled AD for the routable one. |
@JamesNK assigning to you to fix the issue for preview3. |
Describe the bug
The Authorize attribute no longer works in Razor Pages applications.
To Reproduce
[Authorize]
attribute on the Index pageExpected behavior
The page should redirect to the Login page.
Additional context
This is using build
3.0.0-preview-19073-0424
Seems like the authorize attribute isn't being exposed as authorize metadata.
cc @rynowak @pranavkm @JamesNK
The text was updated successfully, but these errors were encountered: