ML Intern deploy
Deploy httpSMS gateway to Hugging Face Spaces (Docker SDK): nginx :7860 -> Go API :8000, Nuxt SPA, Android APK, bootstrap-mode entrypoint
83a59ca
Raw History Blame Contribute Delete
577 Bytes
import { useAuthStore } from '../stores/auth'
export default defineNuxtRouteMiddleware(async (to: { path: string }) => {
const authStore = useAuthStore()
if (!authStore.authStateChanged) {
await new Promise<void>((resolve) => {
const stop = watch(
() => authStore.authStateChanged,
(changed) => {
if (changed) {
stop()
resolve()
}
},
{ immediate: true },
)
})
}
if (authStore.authUser === null) {
return navigateTo({ path: '/login', query: { to: to.path } })
}
})