MCPcopy
hub / github.com/Kong/insomnia / _parseUrl

Function _parseUrl

packages/insomnia/src/main/authorizeUserInWindow.ts:48–63  ·  view source on GitHub ↗
(currentUrl: string, source: string)

Source from the content-addressed store, hash-verified

46 });
47
48 function _parseUrl(currentUrl: string, source: string) {
49 if (currentUrl.match(urlSuccessRegex)) {
50 console.log(`[oauth2] ${source}: Matched success redirect to "${currentUrl}" with ${urlSuccessRegex.toString()}`,);
51 finalUrl = currentUrl;
52 child.close();
53 } else if (currentUrl.match(urlFailureRegex)) {
54 console.log(`[oauth2] ${source}: Matched error redirect to "${currentUrl}" with ${urlFailureRegex.toString()}`,);
55 finalUrl = currentUrl;
56 child.close();
57 } else if (currentUrl === url) {
58 // It's the first one, so it's not a redirect
59 console.log(`[oauth2] ${source}: Loaded "${currentUrl}"`);
60 } else {
61 console.log(`[oauth2] ${source}: Ignoring URL "${currentUrl}". Didn't match ${urlSuccessRegex.toString()}`,);
62 }
63 }
64
65 // Finish on close
66 child.on('close', () => {

Callers 1

authorizeUserInWindowFunction · 0.85

Calls 4

matchMethod · 0.80
logMethod · 0.45
toStringMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected