Sign in is the default: the landing names the account, and an admin lands on /admin

This commit is contained in:
2026-09-18 08:02:57 +07:00
parent 7b79e49c20
commit 2917c034ed
2 changed files with 52 additions and 22 deletions
+7 -4
View File
@@ -290,10 +290,13 @@ export function Workspace() {
// Recipes made in this session, guest ones included. A guest's copy lives
// here and nowhere else, so reloading the page is what deletes it.
const [created, setCreated] = useState<Recipe[]>([]);
// null = closed. /app?auth=1 opens the studio's dialog straight on the sign-up
// tab; the landing page runs the same dialog in place instead of linking here.
const [authMode, setAuthMode] = useState<'login' | 'signup' | null>(() =>
(new URLSearchParams(window.location.search).has('auth') ? 'signup' : null));
// null = closed. /app?auth=1 opens the studio's dialog straight on the sign-in
// tab (sign-in is the default; ?auth=signup asks for the other one); the
// landing page runs the same dialog in place instead of linking here.
const [authMode, setAuthMode] = useState<'login' | 'signup' | null>(() => {
const asked = new URLSearchParams(window.location.search).get('auth');
return asked ? (asked === 'signup' ? 'signup' : 'login') : null;
});
const renderToken = useRef(0);
// Which previewMax the bytes in previewBytes were made at, so the upgrade