Fix: consistently check allowed domains (#2985)

* fix: ensure consistency of checking allowed domain

* chore: update comment to match the logic
This commit is contained in:
Eugene Sokolov
2022-01-24 01:40:18 +00:00
committed by GitHub
parent 390a1343b7
commit b52b1b02fe
4 changed files with 13 additions and 10 deletions

View File

@@ -12,6 +12,11 @@ export function getAllowedDomains(): string[] {
return env ? env.split(",") : [];
}
export function isDomainAllowed(domain: string): boolean {
const allowedDomains = getAllowedDomains();
return allowedDomains.includes(domain) || allowedDomains.length === 0;
}
export async function signIn(
ctx: Context,
user: User,