Skip to content

fix(auth): force full page reload on auth navigation#43

Closed
ntuan2502 wants to merge 1 commit into
reqcore-inc:mainfrom
ntuan2502:fix/force-full-page-reload
Closed

fix(auth): force full page reload on auth navigation#43
ntuan2502 wants to merge 1 commit into
reqcore-inc:mainfrom
ntuan2502:fix/force-full-page-reload

Conversation

@ntuan2502
Copy link
Copy Markdown

@ntuan2502 ntuan2502 commented Feb 26, 2026

Summary

What does this PR change?

  • This PR forces a full page reload on authentication-related navigation (sign in, sign up, and sign out) instead of relying on client-side navigation.

  • Specifically, it ensures that after auth state changes, the app performs a hard reload to reflect the correct authenticated route.

Why is this needed?

There are several issues with the current navigation behavior:

  • On the Sign In page, after clicking "Sign In", the UI gets stuck on "Signing in..." and does not navigate to the dashboard. A manual refresh (F5) is required to proceed to /dashboard.

  • On the Sign Up page, after signing up, the app redirects to /auth/sign-in. However, after a manual refresh, it correctly redirects to /onboarding/create-org.

  • On Sign Out, after clicking "Sign Out", the app remains stuck on the dashboard. Only after refreshing does it redirect to /auth/sign-in.

Because the authentication state appears to be correctly updated but the client-side router does not immediately reflect it, forcing a full page reload ensures the correct route is rendered based on the updated auth state.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Chore

Validation

  • I tested locally
  • I added/updated relevant documentation
  • I verified multi-tenant scoping and auth behavior for affected API paths

DCO

  • All commits in this PR are signed off (Signed-off-by) via git commit -s

Summary by CodeRabbit

  • Refactor
    • Updated navigation handling across authentication workflows (sign-out, sign-in, and sign-up) for improved performance and consistency.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 26, 2026

📝 Walkthrough

Walkthrough

Navigation behavior updated across three authentication-related components to use external navigation option. All sign-out, sign-in, and sign-up routes now include { external: true } flag in their navigateTo() calls.

Changes

Cohort / File(s) Summary
Authentication Navigation
app/components/AppSidebar.vue, app/pages/auth/sign-in.vue, app/pages/auth/sign-up.vue
Added { external: true } option to three navigation calls: sign-out redirect to /auth/sign-in, post-sign-in redirect to /dashboard, and post-sign-up redirect to /onboarding/create-org. No changes to error handling, validation, or loading states.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Three little routes, now marked "external true,"
Navigation hops in a fresh, speedy new way,
Sign in, sign out, sign up—we're through!
The rabbit approves of this tidy ballet. 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding external: true to navigation calls during auth flows to force full page reloads instead of internal navigation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description is comprehensive and well-structured, addressing all key template sections with clear explanations of changes, reasoning, and validation status.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@JoachimLK JoachimLK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for taking the time to look at the codebase and submit a PR! Really appreciate it 🙏

That said, I can't merge this one. A couple of issues:

The second navigateTo call never actually runs — the first one already navigates away, so it's dead code
Adding external: true on internal routes like /dashboard forces a full page reload instead of a smooth navigation, which is actually slower for users
The PR description is empty — I'd love to understand what problem you were trying to solve!
Were you running into a specific bug with navigation? If so, drop a description and I'm happy to dig into it with you. And if you're looking to contribute, check out the good first issue label — there's some good stuff in there to get started with 👍

@ntuan2502
Copy link
Copy Markdown
Author

Hi, thanks for the feedback!

I've updated the PR description to clarify the intent and the problem this change is addressing.
Below are the detailed issues, along with screen recordings for each case:

Sign In: After clicking “Sign In”, the UI gets stuck on the “Signing in...” state and does not navigate to /dashboard. A manual refresh (F5) is required for the redirect to happen.
https://github.com/user-attachments/assets/b0cff1e7-a0b4-4613-a1c9-3f019bfca05b

Sign Up: After signing up, the app redirects to /auth/sign-in. However, after refreshing the page, it correctly redirects to /onboarding/create-org.
https://github.com/user-attachments/assets/4b2d5eca-bbf7-49dd-9680-039632b5bd52

Sign Out: After clicking “Sign Out”, the app remains on the dashboard instead of redirecting to /auth/sign-in. A manual refresh is required for the redirect.
https://github.com/user-attachments/assets/bb320841-9596-4166-b072-e1141aa5eaa3

Please let me know if you’d like me to investigate a more proper fix instead of forcing a full reload — I’m happy to dig deeper into the root cause.

@JoachimLK
Copy link
Copy Markdown
Contributor

Hey @ntuan2502, thanks again for the detailed follow-up with the screen recordings. That really helped confirm the root cause!

I went ahead and implemented a proper fix in #49 (now merged into main) using clearNuxtData() instead of forcing full page reloads. This invalidates the stale Nuxt fetch cache after auth state changes, which is the actual root cause you identified.

Closing this PR in favor of #49, but your investigation was genuinely helpful in pointing this out. Thanks for contributing! 🙏

@JoachimLK JoachimLK closed this Feb 26, 2026
@ntuan2502 ntuan2502 deleted the fix/force-full-page-reload branch February 27, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants