mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
16 lines
586 B
TypeScript
16 lines
586 B
TypeScript
import type { OpenClawConfig } from "../../config/config.js";
|
|
import type { AuthProfileStore } from "./types.js";
|
|
|
|
export function resolveAuthProfileDisplayLabel(params: {
|
|
cfg?: OpenClawConfig;
|
|
store: AuthProfileStore;
|
|
profileId: string;
|
|
}): string {
|
|
const { cfg, store, profileId } = params;
|
|
const profile = store.profiles[profileId];
|
|
const configEmail = cfg?.auth?.profiles?.[profileId]?.email?.trim();
|
|
const email = configEmail || (profile && "email" in profile ? profile.email?.trim() : undefined);
|
|
if (email) return `${profileId} (${email})`;
|
|
return profileId;
|
|
}
|