The wiki-login page needs to be accessible even in coming-soon mode so the OIDC login flow can complete.
18 lines
521 B
JavaScript
18 lines
521 B
JavaScript
export default defineNuxtRouteMiddleware((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
|
|
return navigateTo("/coming-soon");
|
|
});
|