Make it public!
This commit is contained in:
15
lib/config.ts
Normal file
15
lib/config.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'std/dotenv/load.ts';
|
||||
|
||||
import { isThereAnAdmin } from './data/user.ts';
|
||||
|
||||
export async function isSignupAllowed() {
|
||||
const areSignupsAllowed = Deno.env.get('CONFIG_ALLOW_SIGNUPS') === 'true';
|
||||
|
||||
const areThereAdmins = await isThereAnAdmin();
|
||||
|
||||
if (areSignupsAllowed || !areThereAdmins) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user