mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-01 11:50:43 -05:00
fix user signup disabled env could be set to anything to disable signup
This commit is contained in:
@@ -9,7 +9,7 @@ export default async function handle(req: NextApiRequest, res: NextApiResponse)
|
||||
// Required fields in body: email, password (hashed)
|
||||
// Optional fields in body: firstname, lastname
|
||||
if (req.method === "POST") {
|
||||
if (process.env.NEXT_PUBLIC_SIGNUP_DISABLED) {
|
||||
if (process.env.NEXT_PUBLIC_SIGNUP_DISABLED === "1") {
|
||||
res.status(403).json({ error: "Signup disabled" });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ export default function SignInPage() {
|
||||
</Link>
|
||||
)}
|
||||
|
||||
{!process.env.NEXT_PUBLIC_SIGNUP_DISABLED && (
|
||||
{process.env.NEXT_PUBLIC_SIGNUP_DISABLED !== "1" && (
|
||||
<Link href="/auth/signup">
|
||||
<a href="" className="text-red text-xs hover:text-red-600">
|
||||
Create an account
|
||||
|
||||
@@ -32,7 +32,7 @@ export default function SignUpPage() {
|
||||
};
|
||||
return (
|
||||
<BaseLayoutUnauthorized title="Sign up">
|
||||
{process.env.NEXT_PUBLIC_SIGNUP_DISABLED ? (
|
||||
{process.env.NEXT_PUBLIC_SIGNUP_DISABLED === "1" ? (
|
||||
<div className="bg-ui-gray-light flex min-h-screen">
|
||||
<div className="mx-auto flex flex-1 flex-col justify-center px-4 py-12 sm:px-6 lg:flex-none lg:px-20 xl:px-24">
|
||||
<div className="shadow-cont mx-auto w-full max-w-sm rounded-xl bg-white p-8 lg:w-96">
|
||||
|
||||
Reference in New Issue
Block a user