(callbackUrl: string)
| 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( |
no outgoing calls
no test coverage detected