fix(new-nav): wrong redirection on logout#2630
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes the logout/unauthenticated flow in Console v5 so users are redirected to the in-app /login route (instead of Auth0 hosted https://auth.qovery.com/login) and preserves the intended post-login destination.
Changes:
- Redirect unauthenticated access under
/_authenticatedto the Console/loginroute with aredirectquery param. - Extend shared
authLoginto accept an optionalreturnToand pass it via Auth0appState. - Forward the
redirectsearch param from the login route intoauthLoginso Auth0 can restore navigation after login.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| libs/shared/auth/src/lib/use-auth/use-auth.tsx | Adds optional returnTo support to Auth0 loginWithRedirect calls via appState. |
| apps/console-v5/src/routes/login/index.tsx | Reads redirect from route search and passes it to authLogin. |
| apps/console-v5/src/routes/_authenticated.tsx | Redirects unauthenticated users to in-app /login instead of triggering Auth0 hosted login. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## new-navigation #2630 +/- ##
=================================================
Coverage ? 46.11%
=================================================
Files ? 732
Lines ? 17767
Branches ? 5234
=================================================
Hits ? 8194
Misses ? 8128
Partials ? 1445
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
30bd970 to
7f5120f
Compare
Summary
Issue: When automatically logged out, users are redirected to
https://auth.qovery.com/logininstead of the Qovery/loginpage.Slack thread for reference.
Testing
yarn testoryarn test -u(if you need to regenerate snapshots)yarn formatyarn lintPR Checklist
.cursor/rules)feat(service): add new Terraform service) - required for semantic-release