Fixes login handling for Origin and Cache#2278
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the login handling for Origin and Cache by adding a dedicated 403 page for non-admin accounts and adjusting the routing logic to redirect non-admin users appropriately.
- Updated root page extraction and redirection logic in the authentication middleware.
- Added a new frontend page to display a 403 error with account details and logout functionality.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| web_ui/ui.go | Revised authentication redirection and root path extraction logic. |
| web_ui/frontend/app/(login)/403/page.tsx | Introduced the new 403 error page for non-admin accounts. |
|
@CannonLock It seems like |
|
@CannonLock - this is now 1.5 months old, can you get things wrapped up? Seems to be 90% there. |
- Adds 403 page to explain what happened if a user logs in to non admin account - Redirects cache and origin pages if user is not admin Closes PelicanPlatform#2202
… account Redirects cache and origin pages if user is not admin Closes PelicanPlatform#2202
5ed8e04 to
9bba2fe
Compare
|
There're a bunch of auth-related tests failing. Could you take a look? @CannonLock |
h2zh
left a comment
There was a problem hiding this comment.
There're a bunch of auth-related tests failing. Could you take a look?
If you are trying to access an admin only page not as an admin we will send you to a page that explains the distinction. If you are trying to access an admin only page without logging in we will redirect you to login. Signed-off-by: Cannon Lock <clock@wisc.edu>
|
@h2zh I fixed the tests, although I am not sure what to make of the current test failures... |
h2zh
left a comment
There was a problem hiding this comment.
LGTM - the remaining TestStatMemory failure has nothing to do with this PR
Closes #2202