fix: enhance account settings with username and authentication method display #90

This commit is contained in:
Linus Rath
2026-03-23 16:37:56 +01:00
parent 0effb97691
commit ef45140d32
10 changed files with 68 additions and 13 deletions
+12 -4
View File
@@ -486,8 +486,12 @@ export const useAuthStore = create<AuthState>()(
});
await client.connect();
const username = client.getUsername();
const { identities, primaryIdentity } = loadIdentities(await client.getIdentities(), username);
const jmapUsername = client.getUsername();
const { identities, primaryIdentity } = loadIdentities(await client.getIdentities(), jmapUsername);
// For OAuth/OIDC, the JMAP session account name may be the
// preferred_username claim rather than the real email address.
// Prefer the email from the primary identity when available.
const username = primaryIdentity?.email || jmapUsername;
initializeFeatureStores(client);
// Register in account store
@@ -602,8 +606,12 @@ export const useAuthStore = create<AuthState>()(
});
await client.connect();
const username = client.getUsername();
const { identities, primaryIdentity } = loadIdentities(await client.getIdentities(), username);
const jmapUsername = client.getUsername();
const { identities, primaryIdentity } = loadIdentities(await client.getIdentities(), jmapUsername);
// For SSO/OIDC, the JMAP session account name may be the
// preferred_username claim rather than the real email address.
// Prefer the email from the primary identity when available.
const username = primaryIdentity?.email || jmapUsername;
initializeFeatureStores(client);
const accountId = generateAccountId(username, ssoServerUrl);