Skip to content

Commit e5dcc97

Browse files
jeff-zuckerclaude
andcommitted
sol-include: <sol-default solid-kitchen> counts as logged-in
isLoggedIn() now also treats the `solid-kitchen` attribute on <sol-default> as the dev "logged-in" flag (declarative form of the legacy window.SolidKitchen global, which is still honoured for back-compat). Used by the if-logged-in source switch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 2dda660 commit e5dcc97

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

web/sol-include.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ function browserContainer(html) {
3535

3636
/**
3737
* Is there an authenticated user? True for a live Solid session (a logged-in
38-
* <sol-login>, or any logged-in session in the shared AuthManager) AND for the
39-
* `window.SolidKitchen` dev flag, which is treated as exactly equivalent to
40-
* being logged in. Used by the `if-logged-in` source switch.
38+
* <sol-login>, or any logged-in session in the shared AuthManager), and for the
39+
* dev "kitchen" flag — declared as `solid-kitchen` on <sol-default> (or the
40+
* legacy `window.SolidKitchen` global) — treated as exactly equivalent to being
41+
* logged in. Used by the `if-logged-in` source switch.
4142
*/
4243
function isLoggedIn() {
4344
try { if (typeof window !== 'undefined' && window.SolidKitchen === true) return true; } catch { /* ignore */ }
4445
if (typeof document === 'undefined') return false;
46+
if (document.querySelector('sol-default')?.hasAttribute('solid-kitchen')) return true;
4547
const login = document.querySelector('sol-login');
4648
if (login && login.isLoggedIn) return true;
4749
try {

0 commit comments

Comments
 (0)