-
Notifications
You must be signed in to change notification settings - Fork 163
Improve navigation to manage identity from authorization page #3560
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
base: main
Are you sure you want to change the base?
Conversation
…o manage identity from authorization screen.
…o manage identity from authorization screen.
# Conflicts: # src/frontend/src/lib/components/ui/IdentitySwitcher.svelte # src/frontend/src/routes/(new-styling)/+page.svelte # src/frontend/src/routes/(new-styling)/authorize/+layout.svelte # src/frontend/src/routes/(new-styling)/manage/(authenticated)/+layout.svelte
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.
Pull request overview
This PR improves the navigation flow from the authorization page to the identity management dashboard by using secure postMessage-based authentication transfer instead of relying solely on session state. When a user clicks to manage their identity from the authorization page, the system authenticates them if needed, then opens a new window and securely transmits the authentication state to it.
Key changes:
- Introduces a new
/internal-authroute that receives authentication state from an opener window via postMessage and redirects to the management dashboard - Adds
toRelative()utility function to safely convert URLs to relative paths, centralizing URL sanitization logic - Implements
openWindowWithAuth()andrequestAuthFromOpener()functions for secure cross-window authentication transfer with origin validation
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
src/frontend/src/lib/utils/urlUtils.ts |
Adds toRelative() utility to convert absolute URLs to relative paths |
src/frontend/src/lib/utils/urlUtils.test.ts |
Adds tests for the new toRelative() function |
src/frontend/src/routes/(new-styling)/login/+page.ts |
Refactors to use new toRelative() utility instead of inline URL sanitization |
src/frontend/src/routes/(new-styling)/internal-auth/utils.ts |
Implements authentication serialization/deserialization and postMessage-based auth transfer between windows |
src/frontend/src/routes/(new-styling)/internal-auth/+page.ts |
Page loader for internal-auth route that sanitizes the 'next' parameter |
src/frontend/src/routes/(new-styling)/internal-auth/+page.svelte |
Loading page that receives auth from opener window and redirects to management dashboard |
src/frontend/src/routes/(new-styling)/authorize/+layout.svelte |
Adds "manage identity" flow with authentication and new window opening |
src/frontend/src/lib/components/views/ContinueToManage.svelte |
Dialog component prompting user to continue to management dashboard in new window |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…uthorize' into sea-snake/manage-identity-from-authorize
Use internal authentication over post message to improve navigation to manage identity from authorization page.
Changes
ContinueToManagecomponent to views.toRelativetourlUtils.tswith tests and use it for existing/loginroute and newinternal-authroute./authorize/*to use newopenWindowWithAuthmethod to authenticate before opening the dashboard in a new window and then securely transmit this authentication to the new window./internal-authroute to handle receiving and handling this authentication state transmission in a new window.openWindowWithAuthandrequestAuthFromOpenermethods to allow securely transmitting auth from one same origin window to another.Tests
Added
Open dashboard from authorize pagee2e.