Download middleware/auth.ts from binhugg4/web: direct link, hf CLI and curl.
- Browser
- Download file 182 Bytes
-
https://huggingface.co/spaces/binhugg4/web/resolve/main/middleware/auth.ts
- Command line
-
hf download hf://spaces/binhugg4/web/middleware/auth.ts
-
curl -L -o auth.ts https://huggingface.co/spaces/binhugg4/web/resolve/main/middleware/auth.ts
182 Bytes
| export default defineNuxtRouteMiddleware((to) => { | |
| const userStore = useUserStore(); | |
| if (!userStore.isLoggedIn) { | |
| return navigateTo(`/login?redirect=${to.fullPath}`); | |
| } | |
| }); |