File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,10 @@ import {
77 resolvePositiveTimerTimeoutMs ,
88} from "openclaw/plugin-sdk/number-runtime" ;
99import { generatePkceVerifierChallenge , toFormUrlEncoded } from "openclaw/plugin-sdk/provider-auth" ;
10- import { readResponseTextLimited } from "openclaw/plugin-sdk/provider-http" ;
10+ import {
11+ readProviderJsonResponse ,
12+ readResponseTextLimited ,
13+ } from "openclaw/plugin-sdk/provider-http" ;
1114import { ensureGlobalUndiciEnvProxyDispatcher } from "openclaw/plugin-sdk/runtime-env" ;
1215import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime" ;
1316
@@ -121,7 +124,10 @@ async function requestOAuthCode(params: {
121124 throw new Error ( `MiniMax OAuth authorization failed: ${ text || response . statusText } ` ) ;
122125 }
123126
124- const payload = ( await response . json ( ) ) as MiniMaxOAuthAuthorization & { error ?: string } ;
127+ const payload = ( await readProviderJsonResponse (
128+ response ,
129+ "minimax.oauth-code" ,
130+ ) ) as MiniMaxOAuthAuthorization & { error ?: string } ;
125131 if ( ! payload . user_code || ! payload . verification_uri ) {
126132 throw new Error (
127133 payload . error ??
You can’t perform that action at this time.
0 commit comments