fixes #23: go to logged in user page from another one (for admins)
This commit is contained in:
parent
17e0164fa0
commit
54fa1d5908
1 changed files with 7 additions and 1 deletions
|
@ -34,7 +34,7 @@ import IbtSnackbar from './IbtSnackbar.vue';
|
|||
export default {
|
||||
data () {
|
||||
return {
|
||||
user: {email: '', password: null, isAdmin: false},
|
||||
user: {_id: null, email: '', password: null, isAdmin: false},
|
||||
password: null
|
||||
}
|
||||
},
|
||||
|
@ -50,6 +50,12 @@ export default {
|
|||
},
|
||||
|
||||
mounted: function() {
|
||||
this.$router.afterEach((to, from) => {
|
||||
if (this.user._id && this.user._id != this.$route.params.id &&
|
||||
to.name == from.name && to.name == 'user') {
|
||||
this.getUser(this.$route.params.id);
|
||||
}
|
||||
});
|
||||
this.getUser(this.$route.params.id);
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue