Capital/middleware/auth.ts

8 lines
190 B
TypeScript
Raw Normal View History

2024-08-12 15:51:42 +00:00
export default defineNuxtRouteMiddleware((to, from) => {
const state = useLoggedInState();
if (!state.value) {
return navigateTo(`/auth/sign-in?redirect_uri=${to.fullPath}`)
}
})