()
| 18 | * @returns Array of lowercase domain strings that OAuth2 URLs are permitted to contact |
| 19 | */ |
| 20 | export function getOAuth2AllowedDomains(): string[] { |
| 21 | const securityCheckEnabled = process.env.OAUTH2_SECURITY_CHECK !== 'false' |
| 22 | const customDomains = getCustomDomains() |
| 23 | if (securityCheckEnabled) { |
| 24 | return [...new Set([...DEFAULT_ALLOWED_OAUTH2_DOMAINS, ...customDomains])] |
| 25 | } |
| 26 | return customDomains |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Validates an OAuth2 URL against the allowed domain list. |
no test coverage detected