Prevent browser 'Go Back' when you undesirably trying to go to previous page after sign in to your account

This commit is contained in:
Peter Papp
2020-11-22 10:30:06 +01:00
parent 1658627069
commit fefc10afb8
2 changed files with 28 additions and 3 deletions

View File

@@ -188,7 +188,21 @@
// Listen for dragstart folder items
events.$on('dragstart', (item) => this.draggedItem = item)
}
},
beforeRouteLeave(to, from, next) {
// Inquire user about his willing to step back to sign in page
if (to.name === 'SignIn') {
const answer = window.confirm('Do you really want to leave?')
if (answer) {
next()
} else {
next(false)
}
} else {
next()
}
},
}
</script>