fix(ui): use callback url on auth error page#2003
Conversation
Signed-off-by: Petr Kadlec <petr@puradesign.cz>
Summary of ChangesHello @kapetr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug in the authentication flow where, after a server authentication error, the 'Sign in again' button on the error page failed to preserve the intended callback URL. By correctly passing the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request aims to fix an issue where the callback URL is lost on the authentication error page by correctly passing it to the AuthErrorPage component. However, it introduces a potential Open Redirect vulnerability as a user-controlled callbackUrl (aliased to redirectTo) is passed to AuthErrorPage and signOut without proper validation. There's also a logic issue where the current implementation redirects directly to the callback URL after signing out, bypassing the necessary login flow. Feedback includes suggestions to address both the security vulnerability and the logic bug, and to improve code clarity.
apps/agentstack-ui/src/modules/auth/components/AuthErrorPage.tsx
Outdated
Show resolved
Hide resolved
apps/agentstack-ui/src/modules/auth/components/SignInProviders.tsx
Outdated
Show resolved
Hide resolved
apps/agentstack-ui/src/modules/auth/components/AuthErrorPage.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: Petr Kadlec <petr@puradesign.cz>
Summary
After a server auth error (401), the UI shows an error page if a valid token is present to prevent a redirect loop. The user can try logging in again via the provided button, but the callback URL wasn’t being passed along for use after a successful login. This PR fixes that.
Documentation
If this PR adds new feature or changes existing. Make sure documentation is adjusted accordingly. If the docs is not needed, please explain why.