WorkshopTasker/middleware/firstRun.ts

9 lines
270 B
TypeScript
Raw Normal View History

import { defineNuxtRouteMiddleware, navigateTo, useFetch } from "nuxt/app";
export default defineNuxtRouteMiddleware(async (to, from) => {
const firstRun = await useFetch("/api/firstRun");
if (firstRun.data.value)
return navigateTo({ path: "/firstRun" });
});