Skip to content

Commit

Permalink
chore: add route middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
eokwukwe committed May 25, 2020
1 parent aa66029 commit efb02bd
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 8 deletions.
8 changes: 0 additions & 8 deletions middleware/README.md

This file was deleted.

5 changes: 5 additions & 0 deletions middleware/guest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default function({ app, redirect }) {
if (app.$auth.loggedIn) {
return redirect('/')
}
}
2 changes: 2 additions & 0 deletions pages/auth/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@

<script>
export default {
middleware: ['guest'],
data() {
return {
loginForm: this.$vform({
Expand Down
2 changes: 2 additions & 0 deletions pages/auth/password/password-reset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@

<script>
export default {
middleware: ['guest'],
data() {
return {
status: '',
Expand Down
2 changes: 2 additions & 0 deletions pages/auth/password/reset-email.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

<script>
export default {
middleware: ['guest'],
data() {
return {
status: '',
Expand Down
2 changes: 2 additions & 0 deletions pages/auth/register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@

<script>
export default {
middleware: ['guest'],
data() {
return {
registerForm: this.$vform({
Expand Down
2 changes: 2 additions & 0 deletions pages/auth/verification/resend.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@

<script>
export default {
middleware: ['guest'],
data() {
return {
resendForm: this.$vform({
Expand Down
2 changes: 2 additions & 0 deletions pages/auth/verification/verify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

<script>
export default {
middleware: ['guest'],
async asyncData({ params, query, app }) {
// build a query string
const q = Object.keys(query)
Expand Down

0 comments on commit efb02bd

Please sign in to comment.