Skip to content

fix(oauth): make ed25519 optional and add access_token to AccessTokenResponse#487

Merged
crossle merged 1 commit into
MixinNetwork:mainfrom
LixvYang:fix/oauth-backend-client-secret-types
May 12, 2026
Merged

fix(oauth): make ed25519 optional and add access_token to AccessTokenResponse#487
crossle merged 1 commit into
MixinNetwork:mainfrom
LixvYang:fix/oauth-backend-client-secret-types

Conversation

@LixvYang
Copy link
Copy Markdown
Contributor

Problem

The backend OAuth flow (using client_secret) does not use an ed25519 keypair and returns an access_token JWT in the response — not a server ed25519 key. However, the existing types forced callers into the PKCE shape:

  • AccessTokenRequest.ed25519 was required, blocking { client_id, client_secret, code } without as any
  • AccessTokenResponse had no access_token field, so callers couldn't read it without a cast

Changes

Minimal, backward-compatible field changes only — no type renames, no new interfaces:

  • AccessTokenRequest.ed25519: stringstring? (required → optional)
  • AccessTokenResponse.ed25519: stringstring? (required → optional)
  • AccessTokenResponse.access_token: added as string?

Before

// had to cast as any for backend flow
const resp = await (client.oauth.getToken as any)({ client_id, client_secret, code });
const token: string = resp.access_token;

After

// fully typed, no cast needed
const resp = await client.oauth.getToken({ client_id, client_secret, code });
resp.access_token; // string | undefined

Existing PKCE callers are unaffected — passing ed25519 still works as before.

…Response

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.
@crossle crossle merged commit 231fbdf into MixinNetwork:main May 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants