mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 23:01:24 +00:00
fix code review
This commit is contained in:
committed by
Peter Steinberger
parent
e73d881c50
commit
0472dd68f0
@@ -66,6 +66,20 @@ export function upsertAuthProfile(params: {
|
||||
saveAuthProfileStore(store, params.agentDir);
|
||||
}
|
||||
|
||||
export async function upsertAuthProfileWithLock(params: {
|
||||
profileId: string;
|
||||
credential: AuthProfileCredential;
|
||||
agentDir?: string;
|
||||
}): Promise<AuthProfileStore | null> {
|
||||
return await updateAuthProfileStoreWithLock({
|
||||
agentDir: params.agentDir,
|
||||
updater: (store) => {
|
||||
store.profiles[params.profileId] = params.credential;
|
||||
return true;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function listProfilesForProvider(store: AuthProfileStore, provider: string): string[] {
|
||||
const providerKey = normalizeProviderId(provider);
|
||||
return Object.entries(store.profiles)
|
||||
|
||||
Reference in New Issue
Block a user