MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / isValidCallbackPath

Function isValidCallbackPath

apps/web/src/lib/getSignInCallbackUrl.ts:17–41  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

15}
16
17export function isValidCallbackPath(path: string): boolean {
18 if (
19 path.startsWith('/users/accept-invite') ||
20 path.startsWith('/get-started') ||
21 path.startsWith('/welcome/landing') ||
22 path.startsWith('/organizations/') ||
23 path === '/claw' ||
24 path.startsWith('/claw/') ||
25 path.startsWith('/cloud') ||
26 path === '/subscriptions/kilo-pass' ||
27 path.startsWith('/subscriptions/kilo-pass/') ||
28 path.startsWith('/integrations/') ||
29 // Admin-managed URL bonus campaigns. Stricter shape enforcement
30 // (slug format, prefix-match guard) happens in
31 // `isCreditCampaignCallback`; this check only decides whether the
32 // sign-in redirect is allowed to preserve the path.
33 path.startsWith('/c/')
34 ) {
35 return true;
36 }
37 if (isValidIntegrationOAuthConnectCallbackPath(path)) {
38 return true;
39 }
40 return CALLBACK_PATH_REGEX.test(path);
41}
42
43function isValidIntegrationOAuthConnectCallbackPath(path: string): boolean {
44 if (!path.startsWith('/api/integrations/') || path.startsWith('//')) {

Callers 7

GETFunction · 0.90
AccountVerificationPageFunction · 0.90
CustomerSourceSurveyPageFunction · 0.90
getSignInCallbackUrlFunction · 0.85

Tested by

no test coverage detected