🛂 Auth guard
This commit is contained in:
7
middleware/auth.ts
Normal file
7
middleware/auth.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export default defineNuxtRouteMiddleware((to, from) => {
|
||||
const state = useLoggedInState();
|
||||
|
||||
if (!state.value) {
|
||||
return navigateTo(`/auth/sign-in?redirect_uri=${to.fullPath}`)
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user