Add disable registration option
This commit is contained in:
@@ -2,9 +2,15 @@ import type { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
let publicEnvironmentVariables: any = {};
|
||||
Object.entries(process.env).forEach(([key, value]) => {
|
||||
if (key.startsWith("PUBLIC")) {
|
||||
Object.entries(process.env).forEach(([key, value]: any) => {
|
||||
value as string | number | boolean;
|
||||
if (key.startsWith("PUBLIC") && value) {
|
||||
key = key.replace("PUBLIC_", "");
|
||||
if (value == "false" || value == "true") {
|
||||
value = JSON.parse(value);
|
||||
} else if (!isNaN(Number(value))) {
|
||||
value = parseInt(value as string);
|
||||
}
|
||||
publicEnvironmentVariables[key] = value;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user