1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Remove reset password option for admin users

Because admin users shouldn't be able to reset their own password
without entering their password first, this commit removes the "reset
password" option for admin users.

Currently, hitting the reset password option as an admin will result in
a 400 Bad request saying "Admin user passwords must not be empty
(Parameter 'newPassword')"
This commit is contained in:
Topher Johnson 2024-02-20 23:55:59 -08:00
parent 534c820499
commit 7e8e6992f4

View file

@ -33,7 +33,9 @@ const UserPasswordForm: FunctionComponent<IProps> = ({ userId }: IProps) => {
LibraryMenu.setTitle(user.Name);
if (user.HasConfiguredPassword) {
(page.querySelector('#btnResetPassword') as HTMLDivElement).classList.remove('hide');
if (!user.Policy?.IsAdministrator) {
(page.querySelector('#btnResetPassword') as HTMLDivElement).classList.remove('hide');
}
(page.querySelector('#fldCurrentPassword') as HTMLDivElement).classList.remove('hide');
} else {
(page.querySelector('#btnResetPassword') as HTMLDivElement).classList.add('hide');