-
Notifications
You must be signed in to change notification settings - Fork 2.8k
V16: Unwarranted redirect after auth #19935
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
V16: Unwarranted redirect after auth #19935
Conversation
the user may have landed up on the page by mistake
This reverts commit 0c0cc02.
…listening to the authorization signal (and then only listen once for it) also check if the request was null, which means we can safely redirect the user
…n we do not need a new code check
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 pull request refines the OAuth authorization flow in the backoffice app to fix unwarranted redirects and improve handling after authentication. The changes focus on better redirect logic, error handling, and preventing users from getting stuck on the oauth_complete page.
- Centralized redirect logic with a new
redirectToStoredPath
utility function - Enhanced OAuth completion flow with better error handling and authorization checks
- Updated authorization request handler to return more informative results
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
stored-path.function.ts | Added redirectToStoredPath utility function to centralize redirect logic |
auth-flow.ts | Fixed authorization check to use getValue() method |
authorization_request_handler.ts | Changed return type to provide authorization result information |
app.element.ts | Improved OAuth completion setup with async handling and better redirect logic |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/Umbraco.Web.UI.Client/src/packages/core/utils/path/stored-path.function.ts
Outdated
Show resolved
Hide resolved
…path.function.ts Co-authored-by: Copilot <[email protected]>
This is a major annoyance for our client, would be amazing to get it in. Thanks for your work on this @iOvergaard |
Description
Fixes #17642
Fixes #18334
Fixes #19750
This pull request refines the OAuth authorization flow in the backoffice app, improving both the handling and redirection logic after authentication. The main focus is to ensure users are redirected to their intended location after completing OAuth, and to improve error handling and code clarity. Key changes include updating the authorization completion logic to return more informative results, centralizing redirect logic, and improving error feedback.
OAuth flow and redirect improvements
UmbAppElement
to use an async function, handle errors more gracefully, and redirect users to their previous path or root after authorization using the newredirectToStoredPath
utility. [1] [2]retrieveStoredPath
with the newredirectToStoredPath
function for more consistent and centralized redirect behavior. [1] [2]Authorization request handler enhancements
completeAuthorizationRequestIfPossible
inAuthorizationRequestHandler
to return anAuthorizationRequestResponse | null
instead ofvoid
, allowing for more informative handling of the authorization result.Utility function addition
redirectToStoredPath
function to centralize and standardize the logic for redirecting users after authentication, replacing previous ad-hoc implementations.How to test
Unwarranted redirects
Stuck on oauth_complete