mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 05:01:23 +00:00
fix(auth/session): preserve override reset behavior and repair oauth profile-id drift (openclaw#18820) thanks @Glucksberg
Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -10,11 +10,12 @@ export async function writeOAuthCredentials(
|
||||
provider: string,
|
||||
creds: OAuthCredentials,
|
||||
agentDir?: string,
|
||||
): Promise<void> {
|
||||
): Promise<string> {
|
||||
const email =
|
||||
typeof creds.email === "string" && creds.email.trim() ? creds.email.trim() : "default";
|
||||
const profileId = `${provider}:${email}`;
|
||||
upsertAuthProfile({
|
||||
profileId: `${provider}:${email}`,
|
||||
profileId,
|
||||
credential: {
|
||||
type: "oauth",
|
||||
provider,
|
||||
@@ -22,6 +23,7 @@ export async function writeOAuthCredentials(
|
||||
},
|
||||
agentDir: resolveAuthAgentDir(agentDir),
|
||||
});
|
||||
return profileId;
|
||||
}
|
||||
|
||||
export async function setAnthropicApiKey(key: string, agentDir?: string) {
|
||||
|
||||
Reference in New Issue
Block a user