MCPcopy Index your code
hub / github.com/simstudioai/sim / validateCallbackUrl

Function validateCallbackUrl

apps/sim/lib/core/security/input-validation.ts:1208–1219  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

1206 * @returns true if the URL is safe to redirect to
1207 */
1208export function validateCallbackUrl(url: string): boolean {
1209 try {
1210 if (typeof url !== 'string' || url.length === 0) return false
1211
1212 const base = typeof window === 'undefined' ? CALLBACK_URL_SERVER_BASE : window.location.origin
1213 const parsed = new URL(url, base)
1214 return parsed.origin === base
1215 } catch (error) {
1216 logger.error('Error validating callback URL:', { error, url })
1217 return false
1218 }
1219}
1220
1221const OKTA_DOMAIN_PATTERN =
1222 /^[a-zA-Z0-9][a-zA-Z0-9-]*\.(okta|okta-gov|okta-emea|oktapreview|trexcloud)\.com$/

Callers 5

useVerificationFunction · 0.90
SignupFormContentFunction · 0.90
LoginPageFunction · 0.90
SSOFormFunction · 0.90

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected