Fix accepting invite while logged out

This commit is contained in:
x032205
2025-06-06 13:02:23 -04:00
parent e4abac91b4
commit b394e191a8
3 changed files with 9 additions and 4 deletions
@@ -75,8 +75,6 @@ export const Route = createFileRoute("/_restrict-login-signup")({
middlewares: [stripSearchParams({ callback_port: undefined, force: undefined })]
},
beforeLoad: async ({ context, location, search }) => {
if (location.pathname === "/signupinvite") return;
if (!context.serverConfig.initialized) {
if (location.pathname.endsWith("/admin/signup")) return;
throw redirect({ to: "/admin/signup" });
@@ -94,6 +92,8 @@ export const Route = createFileRoute("/_restrict-login-signup")({
setAuthToken(data.token);
if (location.pathname === "/signupinvite") return;
// Avoid redirect if on select-organization page with force=true
if (location.pathname.endsWith("select-organization") && search?.force === true) return;