mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 12:07:40 +00:00
fix(auth): bidirectional mode/type compat + sync OAuth to all agents (#12692)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 2dee8e1174
Co-authored-by: mudrii <220262+mudrii@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
This commit is contained in:
@@ -60,7 +60,7 @@ describe("resolveApiKeyForProfile config compatibility", () => {
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
|
||||
it("rejects oauth credentials when config mode is token", async () => {
|
||||
it("accepts oauth credentials when config mode is token (bidirectional compat)", async () => {
|
||||
const profileId = "anthropic:oauth";
|
||||
const store: AuthProfileStore = {
|
||||
version: 1,
|
||||
@@ -80,7 +80,12 @@ describe("resolveApiKeyForProfile config compatibility", () => {
|
||||
store,
|
||||
profileId,
|
||||
});
|
||||
expect(result).toBeNull();
|
||||
// token ↔ oauth are bidirectionally compatible bearer-token auth paths.
|
||||
expect(result).toEqual({
|
||||
apiKey: "access-123",
|
||||
provider: "anthropic",
|
||||
email: undefined,
|
||||
});
|
||||
});
|
||||
|
||||
it("rejects credentials when provider does not match config", async () => {
|
||||
|
||||
Reference in New Issue
Block a user