diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index 42124fb95..4a1911ffb 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -1751,14 +1751,14 @@ Create new user account src/app/components/common/edit-dialog/user-edit-dialog/user-edit-dialog.component.ts - 41 + 42 Edit user account src/app/components/common/edit-dialog/user-edit-dialog/user-edit-dialog.component.ts - 45 + 46 @@ -2740,19 +2740,19 @@ src/app/components/manage/settings/settings.component.ts - 674 + 686 src/app/components/manage/settings/settings.component.ts - 728 + 740 src/app/components/manage/settings/settings.component.ts - 789 + 801 src/app/components/manage/settings/settings.component.ts - 848 + 860 @@ -2767,19 +2767,19 @@ src/app/components/manage/settings/settings.component.ts - 676 + 688 src/app/components/manage/settings/settings.component.ts - 730 + 742 src/app/components/manage/settings/settings.component.ts - 791 + 803 src/app/components/manage/settings/settings.component.ts - 850 + 862 @@ -4201,172 +4201,179 @@ 626,628 + + Password has been changed, you will be logged out momentarily. + + src/app/components/manage/settings/settings.component.ts + 657 + + Saved user "". src/app/components/manage/settings/settings.component.ts - 653 + 664 Error saving user: . src/app/components/manage/settings/settings.component.ts - 662 + 674 Confirm delete user account src/app/components/manage/settings/settings.component.ts - 672 + 684 This operation will permanently delete this user account. src/app/components/manage/settings/settings.component.ts - 673 + 685 Deleted user src/app/components/manage/settings/settings.component.ts - 682 + 694 Error deleting user: . src/app/components/manage/settings/settings.component.ts - 690 + 702 Saved group "". src/app/components/manage/settings/settings.component.ts - 708 + 720 Error saving group: . src/app/components/manage/settings/settings.component.ts - 716 + 728 Confirm delete user group src/app/components/manage/settings/settings.component.ts - 726 + 738 This operation will permanently delete this user group. src/app/components/manage/settings/settings.component.ts - 727 + 739 Deleted group src/app/components/manage/settings/settings.component.ts - 736 + 748 Error deleting group: . src/app/components/manage/settings/settings.component.ts - 744 + 756 Saved account "". src/app/components/manage/settings/settings.component.ts - 767 + 779 Error saving account: . src/app/components/manage/settings/settings.component.ts - 777 + 789 Confirm delete mail account src/app/components/manage/settings/settings.component.ts - 787 + 799 This operation will permanently delete this mail account. src/app/components/manage/settings/settings.component.ts - 788 + 800 Deleted mail account src/app/components/manage/settings/settings.component.ts - 797 + 809 Error deleting mail account: . src/app/components/manage/settings/settings.component.ts - 806 + 818 Saved rule "". src/app/components/manage/settings/settings.component.ts - 825 + 837 Error saving rule: . src/app/components/manage/settings/settings.component.ts - 836 + 848 Confirm delete mail rule src/app/components/manage/settings/settings.component.ts - 846 + 858 This operation will permanently delete this mail rule. src/app/components/manage/settings/settings.component.ts - 847 + 859 Deleted mail rule src/app/components/manage/settings/settings.component.ts - 856 + 868 Error deleting mail rule: . src/app/components/manage/settings/settings.component.ts - 865 + 877 diff --git a/src-ui/src/app/components/common/edit-dialog/user-edit-dialog/user-edit-dialog.component.ts b/src-ui/src/app/components/common/edit-dialog/user-edit-dialog/user-edit-dialog.component.ts index 8adf6f324..9b3bd9bd8 100644 --- a/src-ui/src/app/components/common/edit-dialog/user-edit-dialog/user-edit-dialog.component.ts +++ b/src-ui/src/app/components/common/edit-dialog/user-edit-dialog/user-edit-dialog.component.ts @@ -18,6 +18,7 @@ export class UserEditDialogComponent implements OnInit { groups: PaperlessGroup[] + passwordIsSet: boolean = false constructor( service: UserService, @@ -76,4 +77,11 @@ export class UserEditDialogComponent (id) => this.groups.find((g) => g.id == id)?.permissions ) } + + save(): void { + this.passwordIsSet = + this.objectForm.get('password').value?.toString().replaceAll('*', '') + .length > 0 + super.save() + } } diff --git a/src-ui/src/app/components/manage/settings/settings.component.ts b/src-ui/src/app/components/manage/settings/settings.component.ts index 727ad3688..b0379dc84 100644 --- a/src-ui/src/app/components/manage/settings/settings.component.ts +++ b/src-ui/src/app/components/manage/settings/settings.component.ts @@ -648,14 +648,26 @@ export class SettingsComponent modal.componentInstance.succeeded .pipe(takeUntil(this.unsubscribeNotifier)) .subscribe({ - next: (newUser) => { - this.toastService.showInfo( - $localize`Saved user "${newUser.username}".` - ) - this.usersService.listAll().subscribe((r) => { - this.users = r.results - this.initialize() - }) + next: (newUser: PaperlessUser) => { + if ( + newUser.id === this.settings.currentUser.id && + (modal.componentInstance as UserEditDialogComponent).passwordIsSet + ) { + this.toastService.showInfo( + $localize`Password has been changed, you will be logged out momentarily.` + ) + setTimeout(() => { + window.location.href = `${window.location.origin}/accounts/logout/?next=/accounts/login/` + }, 2500) + } else { + this.toastService.showInfo( + $localize`Saved user "${newUser.username}".` + ) + this.usersService.listAll().subscribe((r) => { + this.users = r.results + this.initialize() + }) + } }, error: (e) => { this.toastService.showError(