Move redirect to home to no auth component
This commit is contained in:
parent
00d1f9b784
commit
e87243e3f1
|
@ -18,8 +18,25 @@ import {mapState} from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'contentNoAuth',
|
name: 'contentNoAuth',
|
||||||
|
beforeCreate() {
|
||||||
|
this.redirectToHome()
|
||||||
|
},
|
||||||
computed: mapState({
|
computed: mapState({
|
||||||
motd: state => state.config.motd,
|
motd: state => state.config.motd,
|
||||||
}),
|
}),
|
||||||
|
methods: {
|
||||||
|
redirectToHome() {
|
||||||
|
// Check if the user is already logged in and redirect them to the home page if not
|
||||||
|
if (
|
||||||
|
this.$route.name !== 'user.login' &&
|
||||||
|
this.$route.name !== 'user.password-reset.request' &&
|
||||||
|
this.$route.name !== 'user.password-reset.reset' &&
|
||||||
|
this.$route.name !== 'user.register' &&
|
||||||
|
this.$route.name !== 'link-share.auth'
|
||||||
|
) {
|
||||||
|
this.$router.push({name: 'user.login'})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Reference in New Issue
Block a user