Implement authentication composable with signin, signup, and session management; add route middleware for auth checks
This commit is contained in:
1 parent
e1716c3e61
commit
170d24c117
3 files changed
+64
No files matched your search
@@ -0,0 +1,6 @@
|
||||
export default defineNuxtRouteMiddleware((to, from) => {
|
||||
const auth = useAuth()
|
||||
|
||||
if (!auth.refreshToken.value && !to.fullPath.includes("/auth"))
|
||||
return navigateTo("/auth/signin")
|
||||
})
|
||||
Reference in new issue
Block a user