mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-01 13:59:54 +00:00
feat(hostWhitelist): allow comfy.org hosts to authenticate (#5952)
## Summary Add `comfy.org` host names to the list of hosts that can authenticate via SSO. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5952-feat-hostWhitelist-allow-comfy-org-hosts-to-authenticate-2846d73d36508152a41af92ada2a698b) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -42,6 +42,7 @@ export function isHostWhitelisted(rawHost: string): boolean {
|
||||
if (isLocalhostLabel(host)) return true
|
||||
if (isIPv4Loopback(host)) return true
|
||||
if (isIPv6Loopback(host)) return true
|
||||
if (isComfyOrgHost(host)) return true
|
||||
const normalizedList = HOST_WHITELIST.map(normalizeHost)
|
||||
return normalizedList.includes(host)
|
||||
}
|
||||
@@ -89,3 +90,9 @@ function isIPv6Loopback(h: string): boolean {
|
||||
// Require that at least one group was actually compressed: i.e., leftCount + rightCount ≤ 6.
|
||||
return leftCount + rightCount <= 6
|
||||
}
|
||||
|
||||
const COMFY_ORG_HOST = /\.comfy\.org$/
|
||||
|
||||
function isComfyOrgHost(h: string): boolean {
|
||||
return COMFY_ORG_HOST.test(h)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user