Dashboard greeting names who is signed in

It greets the account by its full name where it has one, and otherwise by
the name it signs in with. The line beneath says who is signed in. The account
is looked up by its local part and matched on the whole address, so a
same-named account on another domain can't answer. The username is kept from
the JMAP session and cleared on sign-out.
This commit is contained in:
2026-09-19 00:51:26 -07:00
parent 3fec79545c
commit 96e7b9842f
4 changed files with 53 additions and 7 deletions
+9
View File
@@ -26,6 +26,8 @@ interface AuthState {
apiUrl: string | null;
maxObjectsInGet: number;
maxObjectsInSet: number;
/** INBUXA: who is signed in, from the JMAP session (`username`). */
username: string | null;
setTokens: (
access: string,
@@ -42,6 +44,7 @@ interface AuthState {
maxObjectsInSet?: number,
) => void;
switchAccount: (accountId: string) => void;
setUsername: (username: string | null) => void;
logout: () => void;
isAuthenticated: () => boolean;
isTokenExpiringSoon: () => boolean;
@@ -58,6 +61,11 @@ export const useAuthStore = create<AuthState>()(
accounts: {},
primaryAccountId: null,
activeAccountId: null,
username: null,
setUsername: (username) => {
set({ username });
},
apiUrl: null,
maxObjectsInGet: 500,
maxObjectsInSet: 500,
@@ -103,6 +111,7 @@ export const useAuthStore = create<AuthState>()(
primaryAccountId: null,
activeAccountId: null,
apiUrl: null,
username: null,
});
},