mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-13 10:00:14 +01:00
Fix multi-user setup bug for invalid username/password (#2130)
* fix multiuser setup bug for invalid username/password * handle user creation failed gracefully and delete user on fail
This commit is contained in:
parent
ff0605ce67
commit
1dad4d9409
@ -288,6 +288,11 @@ const MyTeam = ({ setMultiUserLoginValid, myTeamSubmitRef, navigate }) => {
|
||||
onChange={handleUsernameChange}
|
||||
/>
|
||||
</div>
|
||||
<p className=" text-white text-opacity-80 text-xs font-base">
|
||||
Username must be at least 6 characters long and only contain
|
||||
lowercase letters, numbers, underscores, and hyphens with no
|
||||
spaces.
|
||||
</p>
|
||||
<div className="mt-4">
|
||||
<label
|
||||
htmlFor="name"
|
||||
@ -306,9 +311,8 @@ const MyTeam = ({ setMultiUserLoginValid, myTeamSubmitRef, navigate }) => {
|
||||
onChange={handlePasswordChange}
|
||||
/>
|
||||
</div>
|
||||
<p className="w-96 text-white text-opacity-80 text-xs font-base">
|
||||
Username must be at least 6 characters long. Password must be at
|
||||
least 8 characters long.
|
||||
<p className=" text-white text-opacity-80 text-xs font-base">
|
||||
Password must be at least 8 characters long.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -481,6 +481,15 @@ function systemEndpoints(app) {
|
||||
password,
|
||||
role: ROLES.admin,
|
||||
});
|
||||
|
||||
if (error || !user) {
|
||||
response.status(400).json({
|
||||
success: false,
|
||||
error: error || "Failed to enable multi-user mode.",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await SystemSettings._updateSettings({
|
||||
multi_user_mode: true,
|
||||
limit_user_messages: false,
|
||||
|
Loading…
Reference in New Issue
Block a user