From f63af04e087269ecb2e4631d27b05c4786a04f34 Mon Sep 17 00:00:00 2001 From: LixvYang <2690688423@qq.com> Date: Tue, 12 May 2026 10:29:59 +0800 Subject: [PATCH] fix(oauth): make ed25519 optional and add access_token to AccessTokenResponse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The backend client_secret flow does not use an ed25519 keypair and returns an access_token JWT instead of a server ed25519 key. Previously, callers had to cast getToken() as any to pass { client_id, client_secret, code } and read resp.access_token. - AccessTokenRequest.ed25519: required → optional - AccessTokenResponse.ed25519: required → optional - AccessTokenResponse.access_token: added as optional field All changes are backward-compatible: existing PKCE callers are unaffected. --- package.json | 2 +- src/client/types/oauth.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ec95490d..340a77af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mixin.dev/mixin-node-sdk", - "version": "7.5.2", + "version": "7.5.3", "license": "MIT", "description": "Mixin SDK for Node.js and Javascript", "main": "dist/index.js", diff --git a/src/client/types/oauth.ts b/src/client/types/oauth.ts index 4f9d8712..37030ad2 100644 --- a/src/client/types/oauth.ts +++ b/src/client/types/oauth.ts @@ -6,12 +6,14 @@ export interface AccessTokenResponse { scope: string; authorization_id: string; /** public key from server */ - ed25519: string; + ed25519?: string; + access_token?: string; } + export interface AccessTokenRequest { client_id: string; code: string; - ed25519: string; + ed25519?: string; client_secret?: string; code_verifier?: string; }