Skip to content

Commit

Permalink
sec: fix enable-multi-user preflight check to prevent error loop
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycarambat committed Mar 27, 2024
1 parent fa4adb1 commit 99cfee1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/endpoints/system.js
Expand Up @@ -386,16 +386,15 @@ function systemEndpoints(app) {
[validatedRequest],
async (request, response) => {
try {
const { username, password } = reqBody(request);
const multiUserModeEnabled = await SystemSettings.isMultiUserMode();
if (multiUserModeEnabled) {
if (response.locals.multiUserMode) {
response.status(200).json({
success: false,
error: "Multi-user mode is already enabled.",
});
return;
}

const { username, password } = reqBody(request);
const { user, error } = await User.create({
username,
password,
Expand Down

0 comments on commit 99cfee1

Please sign in to comment.