Skip to content
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

#1830 Fix the incorrect route redirection bug #1831

Merged
merged 1 commit into from
Feb 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion frontend/views/pages/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,20 @@ export default ({
sbp('okTurtles.events/emit', OPEN_MODAL, mode)
},
navigateToGroupPage () {
this.$router.push({ path: this.ourGroupProfile ? '/dashboard' : '/pending-approval' }).catch(console.warn)
this.$router.push({
// NOTE:
// When browser refresh is triggered, there is an issue that Vue router prematurely decides ('loginGuard' there) that
// the user is not signed in when in actual reality user-login is still being processed and then
// takes user to 'Home.vue' with the '$route.query.next' being set to the initial url.
// In this particular condition, the app needs to immediately redirect user to '$route.query.next'
// so that the user stays in the same page after the browser refresh.
// (Related GH issue: https://github.com/okTurtles/group-income/issues/1830)
Comment on lines +100 to +106
Copy link
Member

Choose a reason for hiding this comment

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

This comment is perfect! Thanks for the thorough explanation and the link to the issue!

path: this.$route.query.next ?? (
this.ourGroupProfile
? '/dashboard'
: '/pending-approval'
)
}).catch(console.warn)
}
},
watch: {
Expand Down
Loading