Remove auth bypass from coming-soon middleware so no one can access the in-development site in production. Remove unused login button from coming-soon page since wiki has its own OIDC login flow.
18 lines
545 B
JavaScript
18 lines
545 B
JavaScript
export default defineNuxtRouteMiddleware(async (to, from) => {
|
|
const config = useRuntimeConfig();
|
|
const isComingSoonMode =
|
|
config.public.comingSoon === "true" || config.public.comingSoon === true;
|
|
|
|
// Only enforce coming soon mode if enabled
|
|
if (!isComingSoonMode) {
|
|
return;
|
|
}
|
|
|
|
// Allow access to the coming-soon page and OIDC login
|
|
if (to.path === "/coming-soon" || to.path === "/auth/wiki-login") {
|
|
return;
|
|
}
|
|
|
|
// Redirect all other routes to coming-soon — no exceptions
|
|
return navigateTo("/coming-soon");
|
|
});
|