update login flow

This commit is contained in:
JCEEE
2026-09-08 17:45:12 +01:00
parent 02df79968e
commit 10d8b3d29d
3 changed files with 22 additions and 11 deletions
+3 -1
View File
@@ -114,12 +114,14 @@
// session exists. $effect (not onMount) so it also fires when the session
// appears after the layout was already mounted — e.g. a member redeeming
// their OTP on /{fam}/join/{username} then landing on /{fam}/{username}.
// The handle comes from the session (not page.params) so jump-back-in lands
// on the user's own dashboard even from the bare /{fam} page.
$effect(() => {
if (!page.data.session) return;
recordShortcut({
famSlug: (page.data.fam?.slug as string) || page.params.fam || '',
famName: (page.data.fam?.name as string) || page.params.fam || '',
userName: page.data.role === 'parent' ? '' : page.params.username || ''
userName: page.data.session.username || page.params.username || ''
});
});