mirror of
https://github.com/linkwarden/linkwarden.git
synced 2026-03-03 02:27:00 +00:00
minor improvement
This commit is contained in:
@@ -36,7 +36,6 @@ PREVIEW_MAX_BUFFER=
|
||||
IMPORT_LIMIT=
|
||||
PLAYWRIGHT_LAUNCH_OPTIONS_EXECUTABLE_PATH=
|
||||
MAX_WORKERS=
|
||||
DISABLE_INVITES=
|
||||
|
||||
# AWS S3 Settings
|
||||
SPACES_KEY=
|
||||
|
||||
@@ -22,8 +22,6 @@ export default async function postUser(
|
||||
const isAdmin =
|
||||
parentUser && parentUser.id === Number(process.env.NEXT_PUBLIC_ADMIN || 1);
|
||||
|
||||
const DISABLE_INVITES = process.env.DISABLE_INVITES === "true";
|
||||
|
||||
if (process.env.NEXT_PUBLIC_DISABLE_REGISTRATION === "true" && !isAdmin) {
|
||||
return { response: "Registration is disabled.", status: 400 };
|
||||
}
|
||||
@@ -42,7 +40,7 @@ export default async function postUser(
|
||||
const { name, email, password, invite } = dataValidation.data;
|
||||
let { username } = dataValidation.data;
|
||||
|
||||
if (invite && (DISABLE_INVITES || !emailEnabled)) {
|
||||
if (invite && (!stripeEnabled || !emailEnabled)) {
|
||||
return { response: "You are not authorized to invite users.", status: 401 };
|
||||
} else if (invite && !parentUser) {
|
||||
return { response: "You must be logged in to invite users.", status: 401 };
|
||||
|
||||
Reference in New Issue
Block a user