Repository navigation
fix: [Portal] If you sign out of the portal while logged in and using an application that requires authentication, the system will trigger three "Access Denied" error messages. #7805
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
No syntax-only problem, but there are several important issues in this change:
1.
force: trueis not a Vue Router 4 optionrouter.replace({ ..., force: true })is not a valid Vue Router 4 location property. It may cause a TypeScript error or be ignored at runtime. It will not force guards to re-run or force a same-route navigation.If you need to force re-evaluation, prefer navigating to a public/entry route and letting the guard redirect, or explicitly revalidate auth. Avoid
router.go(0)unless a full reload is acceptable.2. Reusing
route.params.accessTokenafter logout is riskyAfter
auth.logout(),route.params.accessTokenis presumably the old user's token. Passing it into the newchat-homelocation can:accessTokenisundefinedorstring[], especially for a required named-route paramPrefer navigating to a token-less/public entry route and let the auth guard resolve the new anonymous session. If
chat-hometruly requires a token, obtain a fresh token from auth state after logout, not from the old route.3.
routeis read asynchronouslyroute.meta.portalandroute.params.accessTokenare read inside.then()afterauth.logout()completes. If logout triggers any navigation or route state change, you may read a different route than the one logout was initiated from. Capture the values before logout if that matters:4. Hard-coded route names may miss required params/query
portal-application-listandchat-homemay require params such as tenant ID, locale, redirect, etc. If those are missing, navigation can fail or be redirected unexpectedly. Consider a single canonical post-logout entry route and let the guard decide the final destination.5.
.catch(() => {})hides all failuresThis swallows both logout failures and navigation failures. If logout fails, the user may still be authenticated but the UI may appear logged out. At minimum log the error; ideally show feedback and distinguish logout failure from navigation failure.
6. No loading/disabled state
Double-clicking logout can trigger multiple
auth.logout()calls and multiple navigations. Consider a loading flag or disabling the logout action while it is in progress.Suggested direction
If
chat-homerequiresaccessToken, do not pass the old token. Either let the guard redirect from a public route, or use a freshly obtained token after logout. Also removeforce: true.