Wroclaw
90932a49c8
now, when the project is ran without configured database, it will prompt for the first user to configure the database and add the first user
8 lines
270 B
TypeScript
8 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" });
|
|
});
|