mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
8 lines
301 B
TypeScript
8 lines
301 B
TypeScript
|
import { DomainExtractor } from "./DomainExtractor";
|
|||
|
|
|||
|
export function BelongToDomain(url: string, domain: string): boolean {
|
|||
|
const urlDomain = DomainExtractor.fromUrl(url);
|
|||
|
if (!urlDomain) return false;
|
|||
|
const idx = urlDomain.indexOf(domain);
|
|||
|
return idx + domain.length == urlDomain.length;
|
|||
|
}
|