mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 11:21:23 +00:00
chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -13,9 +13,7 @@ const WEB_LOGIN_METHODS = new Set(["web.login.start", "web.login.wait"]);
|
||||
|
||||
const resolveWebLoginProvider = () =>
|
||||
listChannelPlugins().find((plugin) =>
|
||||
(plugin.gatewayMethods ?? []).some((method) =>
|
||||
WEB_LOGIN_METHODS.has(method),
|
||||
),
|
||||
(plugin.gatewayMethods ?? []).some((method) => WEB_LOGIN_METHODS.has(method)),
|
||||
) ?? null;
|
||||
|
||||
export const webHandlers: GatewayRequestHandlers = {
|
||||
@@ -41,10 +39,7 @@ export const webHandlers: GatewayRequestHandlers = {
|
||||
respond(
|
||||
false,
|
||||
undefined,
|
||||
errorShape(
|
||||
ErrorCodes.INVALID_REQUEST,
|
||||
"web login provider is not available",
|
||||
),
|
||||
errorShape(ErrorCodes.INVALID_REQUEST, "web login provider is not available"),
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -71,11 +66,7 @@ export const webHandlers: GatewayRequestHandlers = {
|
||||
});
|
||||
respond(true, result, undefined);
|
||||
} catch (err) {
|
||||
respond(
|
||||
false,
|
||||
undefined,
|
||||
errorShape(ErrorCodes.UNAVAILABLE, formatForLog(err)),
|
||||
);
|
||||
respond(false, undefined, errorShape(ErrorCodes.UNAVAILABLE, formatForLog(err)));
|
||||
}
|
||||
},
|
||||
"web.login.wait": async ({ params, respond, context }) => {
|
||||
@@ -100,10 +91,7 @@ export const webHandlers: GatewayRequestHandlers = {
|
||||
respond(
|
||||
false,
|
||||
undefined,
|
||||
errorShape(
|
||||
ErrorCodes.INVALID_REQUEST,
|
||||
"web login provider is not available",
|
||||
),
|
||||
errorShape(ErrorCodes.INVALID_REQUEST, "web login provider is not available"),
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -130,11 +118,7 @@ export const webHandlers: GatewayRequestHandlers = {
|
||||
}
|
||||
respond(true, result, undefined);
|
||||
} catch (err) {
|
||||
respond(
|
||||
false,
|
||||
undefined,
|
||||
errorShape(ErrorCodes.UNAVAILABLE, formatForLog(err)),
|
||||
);
|
||||
respond(false, undefined, errorShape(ErrorCodes.UNAVAILABLE, formatForLog(err)));
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user