Skip to content

Commit 1db2e08

Browse files
committed
chore(deps): bump @corbits package pins
Map oauth-core callback failures onto the callback page.
1 parent 0d780ee commit 1db2e08

3 files changed

Lines changed: 42 additions & 31 deletions

File tree

‎bun.lock‎

Lines changed: 21 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@
8888
},
8989
"dependencies": {
9090
"@anthropic-ai/sandbox-runtime": "0.0.79",
91-
"@corbits/codex-provider": "0.1.2",
92-
"@corbits/oauth-core": "0.3.0",
93-
"@corbits/openai-responses": "0.2.1",
94-
"@corbits/xai-provider": "0.1.2",
91+
"@corbits/codex-provider": "0.1.3",
92+
"@corbits/oauth-core": "0.3.2",
93+
"@corbits/openai-responses": "0.2.2",
94+
"@corbits/xai-provider": "0.1.3",
9595
"@intx/agent": "workspace:*",
9696
"@intx/authz": "workspace:*",
9797
"@intx/crypto": "0.3.0",
@@ -118,7 +118,7 @@
118118
"@corbits/code-agent-explorer": "workspace:*"
119119
},
120120
"devDependencies": {
121-
"@corbits/evals": "^0.1.1",
121+
"@corbits/evals": "^0.1.2",
122122
"@intx/inference-testing": "0.3.0",
123123
"@types/bun": "1.4.3",
124124
"knip": "^6.41.0",

‎src/auth/provider-callback-server.ts‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { startCallbackServer, type CallbackServer } from "@corbits/oauth-core";
1+
import {
2+
startCallbackServer,
3+
type CallbackFailure,
4+
type CallbackServer,
5+
} from "@corbits/oauth-core";
26

37
import {
48
authorizationDoneHtml,
@@ -8,6 +12,12 @@ import {
812

913
export type { CallbackServer };
1014

15+
function callbackFailureText(failure: CallbackFailure): string {
16+
if (failure.providerError !== undefined) return failure.providerError;
17+
if (failure.code === "state_mismatch") return "state mismatch";
18+
return "no code returned";
19+
}
20+
1121
export interface ProviderCallbackServerConfig {
1222
port: number;
1323
host?: string | undefined;
@@ -26,7 +36,10 @@ export async function startProviderCallbackServer(
2636
...(config.host === undefined ? {} : { host: config.host }),
2737
path: config.path,
2838
doneHtml: authorizationDoneHtml(providerLabel, copy),
29-
failedHtml: (reason) =>
30-
callbackPageHtml({ subject: providerLabel, error: reason }, copy),
39+
failedHtml: (failure) =>
40+
callbackPageHtml(
41+
{ subject: providerLabel, error: callbackFailureText(failure) },
42+
copy,
43+
),
3144
});
3245
}

0 commit comments

Comments
 (0)