@@ -0,0 +1,5 @@
+export default function ({ store }, redirect) {
+ if (store.getters.isAuthenticated) {
+ return redirect('/')
+ }
+}
@@ -1,3 +1,9 @@
<template>
<p>login</p>
</template>
+
+<script>
+export default {
+ middleware: 'auth'
+</script>
@@ -52,6 +52,7 @@
<script>
export default {
+ middleware: 'auth',
data: () => ({
form: {
email: '',
@@ -69,7 +70,7 @@ export default {
watch: {
isAuthenticated (value) {
if (value) {
- setTimeout(() => this.$router.push('/'), 2000)
+ setTimeout(() => this.$router.push('/'), 500)
}
},