We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70d1b43 commit c0b344dCopy full SHA for c0b344d
middleware/authenticated.js
@@ -0,0 +1,6 @@
1
+export default function({ store, redirect }) {
2
+ // If the user is not authenticated
3
+ if (!store.state.authenticated) {
4
+ return redirect('/login')
5
+ }
6
+}
pages/index.vue
@@ -47,6 +47,7 @@ import Modal from '@/components/Modal'
47
48
export default {
49
name: 'Home',
50
+ middleware: 'authenticated',
51
components: {
52
TopBar,
53
Datatable,
0 commit comments