Skip to content
Snippets Groups Projects
Commit e6da52d0 authored by Martin Weise's avatar Martin Weise
Browse files

Merge branch '244-redirect-routes-after-login' into 'dev'

Redirecting to Target Route after Login

See merge request !107
parents 0da7ab69 4c95b211
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 @@ ...@@ -75,7 +75,7 @@
v-if="!token" v-if="!token"
class="mr-2" class="mr-2"
color="secondary" color="secondary"
to="/login"> @click="login">
<v-icon left>mdi-login</v-icon> Login <v-icon left>mdi-login</v-icon> Login
</v-btn> </v-btn>
<v-btn <v-btn
...@@ -262,6 +262,10 @@ export default { ...@@ -262,6 +262,10 @@ export default {
subtitle: item.item.description 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) { navigate (item) {
this.$router.push(this.metadata(item).link) this.$router.push(this.metadata(item).link)
}, },
......
...@@ -96,7 +96,7 @@ export default { ...@@ -96,7 +96,7 @@ export default {
delete user.token delete user.token
this.$store.commit('SET_USER', user) this.$store.commit('SET_USER', user)
this.$toast.success('Welcome back!') this.$toast.success('Welcome back!')
this.$router.push('/container') this.$router.push(this.$route.query.redirect ? this.$route.query.redirect : '/container')
} catch (err) { } catch (err) {
if (err.response !== undefined && err.response.status !== undefined) { if (err.response !== undefined && err.response.status !== undefined) {
if (err.response.status === 418) { 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