mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-29 07:01:40 +03:00
chore: Run pnpm format:fix.
This commit is contained in:
@@ -19,7 +19,11 @@ function modelRef(modelId: string): string {
|
||||
return `${PROVIDER_ID}/${modelId}`;
|
||||
}
|
||||
|
||||
function buildModelDefinition(params: { id: string; name: string; input: Array<"text" | "image"> }) {
|
||||
function buildModelDefinition(params: {
|
||||
id: string;
|
||||
name: string;
|
||||
input: Array<"text" | "image">;
|
||||
}) {
|
||||
return {
|
||||
id: params.id,
|
||||
name: params.name,
|
||||
|
||||
@@ -98,9 +98,7 @@ async function requestOAuthCode(params: {
|
||||
);
|
||||
}
|
||||
if (payload.state !== params.state) {
|
||||
throw new Error(
|
||||
"MiniMax OAuth state mismatch: possible CSRF attack or session corruption.",
|
||||
);
|
||||
throw new Error("MiniMax OAuth state mismatch: possible CSRF attack or session corruption.");
|
||||
}
|
||||
return payload;
|
||||
}
|
||||
@@ -144,9 +142,7 @@ async function pollOAuthToken(params: {
|
||||
return {
|
||||
status: "error",
|
||||
message:
|
||||
payload?.base_resp?.status_msg ??
|
||||
text ||
|
||||
"MiniMax OAuth failed to parse response.",
|
||||
(payload?.base_resp?.status_msg ?? text) || "MiniMax OAuth failed to parse response.",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -165,9 +161,9 @@ async function pollOAuthToken(params: {
|
||||
};
|
||||
|
||||
if (tokenPayload.status === "error") {
|
||||
return { status: "error", message: "An error occurred. Please try again later"};
|
||||
return { status: "error", message: "An error occurred. Please try again later" };
|
||||
}
|
||||
|
||||
|
||||
if (tokenPayload.status != "success") {
|
||||
return { status: "pending", message: "current user code is not authorized" };
|
||||
}
|
||||
@@ -215,7 +211,6 @@ export async function loginMiniMaxPortalOAuth(params: {
|
||||
let pollIntervalMs = oauth.interval ? oauth.interval : 2000;
|
||||
const expireTimeMs = oauth.expired_in;
|
||||
|
||||
|
||||
while (Date.now() < expireTimeMs) {
|
||||
params.progress.update("Waiting for MiniMax OAuth approval…");
|
||||
const result = await pollOAuthToken({
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
{
|
||||
"id": "minimax-portal-auth",
|
||||
"providers": [
|
||||
"minimax-portal"
|
||||
],
|
||||
"providers": ["minimax-portal"],
|
||||
"configSchema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "@openclaw/minimax-portal-auth",
|
||||
"version": "2026.1.30",
|
||||
"type": "module",
|
||||
"description": "OpenClaw MiniMax Portal OAuth provider plugin",
|
||||
"type": "module",
|
||||
"openclaw": {
|
||||
"extensions": [
|
||||
"./index.ts"
|
||||
|
||||
Reference in New Issue
Block a user