redirect users after logging in
This commit is contained in:
parent
e16d5411d5
commit
77e7a7d93a
|
@ -30,6 +30,7 @@ export default {
|
|||
methods: {
|
||||
logout() {
|
||||
this.$store.dispatch('logout');
|
||||
this.$router.replace('/coaches');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -80,6 +80,8 @@ export default {
|
|||
} else {
|
||||
await this.$store.dispatch('signup', actionPayload);
|
||||
}
|
||||
const redirectUrl = '/' + (this.$route.query.redirect || 'coaches');
|
||||
this.$router.replace(redirectUrl);
|
||||
} catch (error) {
|
||||
this.error = error.message || 'Failed to authenticate, try later.';
|
||||
}
|
||||
|
|
|
@ -16,7 +16,9 @@
|
|||
<base-button mode="outline" @click="loadCoaches(true)"
|
||||
>Refresh</base-button
|
||||
>
|
||||
<base-button link to="/auth" v-if="!isLogggedIn">Login</base-button>
|
||||
<base-button link to="/auth?redirect=register" v-if="!isLogggedIn"
|
||||
>Login to Register</base-button
|
||||
>
|
||||
<base-button
|
||||
v-if="isLogggedIn && !isCoach && !isLoading"
|
||||
link
|
||||
|
|
Reference in New Issue