9 lines
270 B
TypeScript
9 lines
270 B
TypeScript
|
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" });
|
||
|
});
|