Skip to content

fix(new-nav): wrong redirection on logout#2630

Merged
rmnbrd merged 1 commit intonew-navigationfrom
fix/new-nav/logout-redirect-page
Apr 24, 2026
Merged

fix(new-nav): wrong redirection on logout#2630
rmnbrd merged 1 commit intonew-navigationfrom
fix/new-nav/logout-redirect-page

Conversation

@rmnbrd
Copy link
Copy Markdown
Contributor

@rmnbrd rmnbrd commented Apr 24, 2026

Summary

Issue: When automatically logged out, users are redirected to https://auth.qovery.com/login instead of the Qovery /login page.

Slack thread for reference.

Testing

  • Changes tested locally in the relevant Console's pages and Storybooks
  • yarn test or yarn test -u (if you need to regenerate snapshots)
  • yarn format
  • yarn lint

PR Checklist

  • I followed naming, styling, and TypeScript rules (see .cursor/rules)
  • I performed a self-review (diff inspected, dead code removed)
  • I titled the PR using Conventional Commits with a scope when possible (e.g. feat(service): add new Terraform service) - required for semantic-release
  • I only kept necessary comments, written in English (watch for useless AI comments)
  • I involved a designer to validate UI changes if I am not a designer
  • I covered new business logic with tests (unit)
  • I confirmed CI is green (Codecov red can be accepted)
  • I reviewed and executed locally any AI-assisted code

@rmnbrd rmnbrd marked this pull request as ready for review April 24, 2026 09:35
Copilot AI review requested due to automatic review settings April 24, 2026 09:35
@rmnbrd rmnbrd self-assigned this Apr 24, 2026
@rmnbrd rmnbrd added the V5 label Apr 24, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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 /_authenticated to the Console /login route with a redirect query param.
  • Extend shared authLogin to accept an optional returnTo and pass it via Auth0 appState.
  • Forward the redirect search param from the login route into authLogin so 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.

Comment thread apps/console-v5/src/routes/login/index.tsx
Comment thread libs/shared/auth/src/lib/use-auth/use-auth.tsx
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (new-navigation@ae78f39). Learn more about missing BASE report.

Files with missing lines Patch % Lines
libs/shared/auth/src/lib/use-auth/use-auth.tsx 50.00% 1 Missing ⚠️
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           
Flag Coverage Δ
unittests 46.11% <50.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@RemiBonnet RemiBonnet force-pushed the fix/new-nav/logout-redirect-page branch from 30bd970 to 7f5120f Compare April 24, 2026 13:07
@rmnbrd rmnbrd merged commit e2e198e into new-navigation Apr 24, 2026
25 checks passed
@rmnbrd rmnbrd deleted the fix/new-nav/logout-redirect-page branch April 24, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants