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