MCPcopy Index your code
hub / github.com/QLHazyCoder/FlowPilot / isLocalhostOAuthCallbackUrl

Function isLocalhostOAuthCallbackUrl

background.js:3296–3308  ·  view source on GitHub ↗
(rawUrl)

Source from the content-addressed store, hash-verified

3294}
3295
3296function isLocalhostOAuthCallbackUrl(rawUrl) {
3297 if (typeof navigationUtils !== 'undefined' && navigationUtils?.isLocalhostOAuthCallbackUrl) {
3298 return navigationUtils.isLocalhostOAuthCallbackUrl(rawUrl);
3299 }
3300 const parsed = parseUrlSafely(rawUrl);
3301 if (!parsed) return false;
3302 if (!['http:', 'https:'].includes(parsed.protocol)) return false;
3303 if (!['localhost', '127.0.0.1'].includes(parsed.hostname)) return false;
3304 if (!['/auth/callback', '/codex/callback'].includes(parsed.pathname)) return false;
3305 const code = (parsed.searchParams.get('code') || '').trim();
3306 const state = (parsed.searchParams.get('state') || '').trim();
3307 return Boolean(code && state);
3308}
3309
3310function isLocalCpaUrl(rawUrl) {
3311 if (typeof navigationUtils !== 'undefined' && navigationUtils?.isLocalCpaUrl) {

Callers 3

handleStepDataFunction · 0.70

Calls 1

parseUrlSafelyFunction · 0.70

Tested by

no test coverage detected