disable domain check temporary
Signed-off-by: pakintada@gmail.com <Pakin>
This commit is contained in:
parent
274025ed33
commit
5ef2b2bfc0
1 changed files with 11 additions and 13 deletions
|
|
@ -1,17 +1,15 @@
|
||||||
import { doc, getDoc } from "firebase/firestore";
|
import { doc, getDoc } from 'firebase/firestore';
|
||||||
import { db } from "../client/firebase";
|
import { db } from '../client/firebase';
|
||||||
|
|
||||||
|
|
||||||
export async function checkAllowAccess(userDomain: string): Promise<boolean> {
|
export async function checkAllowAccess(userDomain: string): Promise<boolean> {
|
||||||
|
const docRef = doc(db, 'whitelist', 'allowedDomains');
|
||||||
|
const snapshot = await getDoc(docRef);
|
||||||
|
|
||||||
const docRef = doc(db, "whitelist", "allowedDomains");
|
if (snapshot.exists()) {
|
||||||
const snapshot = await getDoc(docRef);
|
let domains = snapshot.data();
|
||||||
|
// console.log(`domains: ${JSON.stringify(domains)}`);
|
||||||
|
return domains['account_email'].includes(userDomain);
|
||||||
|
}
|
||||||
|
|
||||||
if(snapshot.exists()){
|
return true;
|
||||||
let domains = snapshot.data();
|
}
|
||||||
// console.log(`domains: ${JSON.stringify(domains)}`);
|
|
||||||
return domains["account_email"].includes(userDomain);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue