fix: show sign-in gate on private spaces instead of redirecting away

Previously, visiting a private space on *.rspace.online without a session
redirected to rspace.online, causing a redirect loop after login. Now shows
the sign-in gate in-place so the user logs in and stays on the same page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-04-11 09:05:44 -04:00
parent 928867a9e2
commit c8622bd82b
1 changed files with 1 additions and 7 deletions

View File

@ -844,14 +844,8 @@ export function renderShell(opts: ShellOptions): string {
return; return;
} }
// Private spaces: redirect logged-out visitors to the module landing page // Private spaces: show sign-in gate for logged-out visitors
if (!hasToken) { if (!hasToken) {
var host = window.location.host.split(':')[0];
if (host.endsWith('.rspace.online') || host === 'rspace.online') {
var modId = document.body.getAttribute('data-module-id') || 'rspace';
window.location.replace('https://rspace.online/' + modId);
return;
}
showGate('sign-in'); showGate('sign-in');
return; return;
} }