Members (and pre-registrants) hitting wiki.ghostguild.org were getting bounced to /coming-soon with a "Pre-Register" link, even when the OIDC flow was working correctly. - Allowlist /auth/oidc-error, /auth/logout-confirm, /auth/logout-success, and /verify in the coming-soon middleware so OIDC errors and main-site magic links stop redirecting to the pre-register page. - Raise OIDC Interaction TTL from 10m to 15m so it outlives the magic-link JWT and legitimate members don't hit expired-interaction errors when they click the email a few minutes late. - Differentiate the "email isn't a registered member" response on the wiki login route and show a dedicated "Not a member yet" state with a pre-register link and contact email, instead of the misleading "Check your inbox" that silently failed.
26 lines
741 B
JavaScript
26 lines
741 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, OIDC login, and admin routes
|
|
if (
|
|
to.path === "/coming-soon" ||
|
|
to.path === "/auth/wiki-login" ||
|
|
to.path === "/auth/oidc-error" ||
|
|
to.path === "/auth/logout-confirm" ||
|
|
to.path === "/auth/logout-success" ||
|
|
to.path === "/verify" ||
|
|
to.path.startsWith("/admin")
|
|
) {
|
|
return;
|
|
}
|
|
|
|
// Redirect all other routes to coming-soon
|
|
return navigateTo("/coming-soon");
|
|
});
|