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 { db } from "../client/firebase";
|
||||
|
||||
import { doc, getDoc } from 'firebase/firestore';
|
||||
import { db } from '../client/firebase';
|
||||
|
||||
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");
|
||||
const snapshot = await getDoc(docRef);
|
||||
if (snapshot.exists()) {
|
||||
let domains = snapshot.data();
|
||||
// console.log(`domains: ${JSON.stringify(domains)}`);
|
||||
return domains['account_email'].includes(userDomain);
|
||||
}
|
||||
|
||||
if(snapshot.exists()){
|
||||
let domains = snapshot.data();
|
||||
// console.log(`domains: ${JSON.stringify(domains)}`);
|
||||
return domains["account_email"].includes(userDomain);
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue