MCPcopy Index your code
hub / github.com/CapSoftware/Cap / createAuthStart

Function createAuthStart

apps/chrome-extension/src/shared/api.ts:110–122  ·  view source on GitHub ↗
(settings: ExtensionSettings)

Source from the content-addressed store, hash-verified

108};
109
110export const createAuthStart = async (settings: ExtensionSettings) => {
111 const redirectUri = chrome.identity.getRedirectURL();
112 const state = crypto.randomUUID();
113 const url = new URL(
114 apiUrl(settings, extensionApiPath(ExtensionApiPaths.startAuth)),
115 );
116 url.searchParams.set("redirectUri", redirectUri);
117 url.searchParams.set("state", state);
118
119 await checkAuthStartRoute(settings, url, redirectUri);
120
121 return { redirectUri, state, url: url.toString() };
122};
123
124export const parseAuthResponse = (responseUrl: string, state: string) => {
125 const hash = new URL(responseUrl).hash.slice(1);

Callers 1

beginAuthFlowFunction · 0.90

Calls 3

apiUrlFunction · 0.85
extensionApiPathFunction · 0.85
checkAuthStartRouteFunction · 0.85

Tested by

no test coverage detected