Skip to content
Snippets Groups Projects
Commit 4c95b211 authored by Josef Taha's avatar Josef Taha
Browse files

Routes are redirected while login

parent 0da7ab69
No related branches found
No related tags found
4 merge requests!129New module for citation as they occur multiple,!121Modified logging, modified logging level, modified flasgger endpoint,!113Resolve "Bugs related with Query Service",!107Redirecting to Target Route after Login
......@@ -75,7 +75,7 @@
v-if="!token"
class="mr-2"
color="secondary"
to="/login">
@click="login">
<v-icon left>mdi-login</v-icon> Login
</v-btn>
<v-btn
......@@ -262,6 +262,10 @@ export default {
subtitle: item.item.description
}
},
login () {
let redirect = ![undefined ,'/', '/login'].includes(this.$router.currentRoute.path)
this.$router.push({ path: '/login', query: redirect ? { redirect: this.$router.currentRoute.path } : {}})
},
navigate (item) {
this.$router.push(this.metadata(item).link)
},
......
......@@ -96,7 +96,7 @@ export default {
delete user.token
this.$store.commit('SET_USER', user)
this.$toast.success('Welcome back!')
this.$router.push('/container')
this.$router.push(this.$route.query.redirect ? this.$route.query.redirect : '/container')
} catch (err) {
if (err.response !== undefined && err.response.status !== undefined) {
if (err.response.status === 418) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment