MCPcopy Create free account
hub / github.com/docker/docker-agent / signIn

Function signIn

cmd/wasm/web/auth.js:73–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71// signIn kicks off the PKCE flow. The function does not return — the tab
72// navigates away to OpenRouter.
73export async function signIn() {
74 const verifier = randomVerifier();
75 sessionStorage.setItem(VERIFIER_KEY, verifier);
76 const challenge = await s256(verifier);
77
78 const url = new URL("https://openrouter.ai/auth");
79 url.searchParams.set("callback_url", callbackURL());
80 url.searchParams.set("code_challenge", challenge);
81 url.searchParams.set("code_challenge_method", "S256");
82
83 location.assign(url.toString());
84}
85
86// handleCallback completes the PKCE flow if the page was loaded with a `code`
87// query parameter. It removes the param from the URL on success so a refresh

Callers

nothing calls this directly

Calls 3

randomVerifierFunction · 0.85
s256Function · 0.85
callbackURLFunction · 0.85

Tested by

no test coverage detected