auth.ts 232 B

12345678910
  1. import { Middleware } from '@nuxt/types'
  2. const auth: Middleware = async ({ store, redirect }) => {
  3. // If the user is not authenticated
  4. if (!store.state.profile.access) {
  5. return redirect('/login')
  6. }
  7. }
  8. export default auth