mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
fixed 127.0.0.1 not recognized as localhost
This commit is contained in:
parent
075ca1d303
commit
8495bb0ae2
@ -1,7 +1,7 @@
|
||||
import { DomainConfigJson } from "@stackframe/stack-shared/dist/interface/clientInterface";
|
||||
|
||||
export function validateUrl(url: string, domains: DomainConfigJson[], allowLocalhost: boolean): boolean {
|
||||
if (allowLocalhost && new URL(url).hostname === "localhost") {
|
||||
if (allowLocalhost && new URL(url).hostname === "localhost" && new URL(url).hostname === "127.0.0.1") {
|
||||
return true;
|
||||
}
|
||||
return domains.some((domain) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user