fix: remove auto-redirect from demo space for logged-in users
Signed-in users can now browse the demo space without being automatically redirected to their personal space. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ebdda1e443
commit
9ed9757a2a
|
|
@ -2298,29 +2298,6 @@
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// ── Auto-space resolution (logged-in users on demo → personal space) ──
|
|
||||||
(function() {
|
|
||||||
try {
|
|
||||||
var raw = localStorage.getItem('encryptid_session');
|
|
||||||
if (!raw) return;
|
|
||||||
var session = JSON.parse(raw);
|
|
||||||
if (!session || !session.claims || !session.claims.username) return;
|
|
||||||
if (communitySlug !== 'demo') return;
|
|
||||||
fetch('/api/spaces/auto-provision', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Authorization': 'Bearer ' + session.accessToken,
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
}
|
|
||||||
}).then(function(r) { return r.json(); })
|
|
||||||
.then(function(data) {
|
|
||||||
if (data.slug) {
|
|
||||||
window.location.replace(rspaceNavUrl(data.slug, 'rspace'));
|
|
||||||
}
|
|
||||||
}).catch(function() {});
|
|
||||||
} catch(e) {}
|
|
||||||
})();
|
|
||||||
|
|
||||||
// ── Welcome overlay (first visit to demo) ──
|
// ── Welcome overlay (first visit to demo) ──
|
||||||
(function() {
|
(function() {
|
||||||
if (communitySlug !== 'demo') return;
|
if (communitySlug !== 'demo') return;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue