diff --git a/src/apps/dashboard/routes/users/profile.tsx b/src/apps/dashboard/routes/users/profile.tsx index 36afb9ca9f..028e6ad870 100644 --- a/src/apps/dashboard/routes/users/profile.tsx +++ b/src/apps/dashboard/routes/users/profile.tsx @@ -225,6 +225,12 @@ const UserEdit = () => { user.Policy.EnableContentDeletionFromFolders = user.Policy.EnableContentDeletion ? [] : getCheckedElementDataIds(page.querySelectorAll('.chkFolder')); user.Policy.SyncPlayAccess = (page.querySelector('#selectSyncPlayAccess') as HTMLSelectElement).value as SyncPlayUserAccessType; + if (!user.HasPassword && user.Policy.IsAdministrator) { + toast(globalize.translate('PasswordAdminRequired')); + loading.hide(); + return; + } + window.ApiClient.updateUser(user).then(() => ( window.ApiClient.updateUserPolicy(user.Id || '', user.Policy || { PasswordResetProviderId: '', AuthenticationProviderId: '' }) )).then(() => { diff --git a/src/strings/en-us.json b/src/strings/en-us.json index 2d6678c325..3f0c0b39ae 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -1318,6 +1318,7 @@ "PackageInstallFailed": "{0} (version {1}) installation failed.", "PageNotFound": "This is not the page you are looking for.", "ParentalRating": "Parental rating", + "PasswordAdminRequired": "The user must have a password set before marking them as admin.", "PasswordMatchError": "Password and password confirmation must match.", "PasswordRequiredForAdmin": "A password is required for admin accounts.", "PasswordResetComplete": "The password has been reset.",