From d4b2087bc54e54ddc2ae0b7be9db01f4601a00e7 Mon Sep 17 00:00:00 2001 From: eti Date: Wed, 23 Sep 2026 18:33:11 +0200 Subject: [PATCH] web: stop deleting your own session when loading repo owners on login Signed-off-by: eti --- web/src/lib/auth.svelte.ts | 1 + web/src/lib/components/repo/RepoCreationForm.svelte | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/lib/auth.svelte.ts b/web/src/lib/auth.svelte.ts index 9ebd3b5e9..3c7b60aef 100644 --- a/web/src/lib/auth.svelte.ts +++ b/web/src/lib/auth.svelte.ts @@ -290,6 +290,7 @@ export const createAuth = ( profile: handle ? { did, handle } : null }; persistActive(did, handle ?? did); + syncAccounts(); void hydrateProfile(did, nextAgent); }; diff --git a/web/src/lib/components/repo/RepoCreationForm.svelte b/web/src/lib/components/repo/RepoCreationForm.svelte index bfd6c4da3..5d0a99b41 100644 --- a/web/src/lib/components/repo/RepoCreationForm.svelte +++ b/web/src/lib/components/repo/RepoCreationForm.svelte @@ -119,7 +119,7 @@ }); const agentForOwner = async (ownerDid: Did, options?: { relogin?: boolean }) => { if (!user) throw new Error("Sign in to continue."); - if (auth.accounts.some((account) => account.did === ownerDid)) + if (ownerDid === user.did || auth.hasAccount(ownerDid)) return auth.agentFor(ownerDid, options); return getOrCreateDelegatedSession(await auth.agentFor(user.did, options), ownerDid); }; -- 2.51.2