MCPcopy Index your code
hub / github.com/gitify-app/gitify / handleCallback

Function handleCallback

src/renderer/utils/auth/flows.ts:50–72  ·  view source on GitHub ↗
(callbackUrl: string)

Source from the content-addressed store, hash-verified

48 openExternalLink(url as Link);
49
50 const handleCallback = (callbackUrl: string) => {
51 const url = new URL(callbackUrl);
52
53 const type = url.hostname;
54 const code = url.searchParams.get('code');
55 const error = url.searchParams.get('error');
56 const errorDescription = url.searchParams.get('error_description');
57 const errorUri = url.searchParams.get('error_uri');
58
59 if (code && type === 'oauth') {
60 resolve({
61 authMethod: 'OAuth App',
62 authCode: code as AuthCode,
63 authOptions: authOptions,
64 });
65 } else if (error) {
66 reject(
67 new Error(
68 `Oops! Something went wrong and we couldn't log you in using GitHub. Please try again. Reason: ${errorDescription} Docs: ${errorUri}`,
69 ),
70 );
71 }
72 };
73
74 window.gitify.onAuthCallback((callbackUrl: string) => {
75 rendererLogInfo(

Callers 1

performGitHubWebOAuthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected