MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / authorize

Function authorize

crates/opencode-plugin/builtin/codex-auth.ts:19–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17 },
18 ],
19 async authorize() {
20 return {
21 method: "code",
22 instructions:
23 "Open ChatGPT/Codex authorization and paste the returned code/token here.",
24 callback: async (code?: string) => {
25 const value = code?.trim();
26 if (!value) return { type: "failed" };
27 return {
28 type: "success",
29 access: value,
30 refresh: value,
31 expires: Date.now() + 3600 * 1000,
32 };
33 },
34 };
35 },
36 async loader() {
37 const key = process.env.OPENAI_API_KEY?.trim();
38 if (!key) return {};

Callers 1

oauth_authorizeFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected