RED-8209: fixed wrong error message upon password reset.
This commit is contained in:
parent
ee3dd12f80
commit
92bf6228a7
@ -1,9 +1,8 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { UserService } from '@users/user.service';
|
||||
import { IconButtonTypes, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { IconButtonTypes, LoadingService } from '@iqser/common-ui';
|
||||
import { User } from '@red/domain';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
@ -20,25 +19,20 @@ export class ResetPasswordComponent {
|
||||
private readonly _formBuilder: UntypedFormBuilder,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _toaster: Toaster,
|
||||
) {}
|
||||
|
||||
async save() {
|
||||
this._loadingService.start();
|
||||
try {
|
||||
await firstValueFrom(
|
||||
this._userService.resetPassword(
|
||||
{
|
||||
password: this.form.get('temporaryPassword').value,
|
||||
temporary: true,
|
||||
},
|
||||
this.user.id,
|
||||
),
|
||||
);
|
||||
this.toggleResetPassword.emit();
|
||||
} catch (error) {
|
||||
this._toaster.error(_('reset-password-dialog.error.password-policy'));
|
||||
}
|
||||
await firstValueFrom(
|
||||
this._userService.resetPassword(
|
||||
{
|
||||
password: this.form.get('temporaryPassword').value,
|
||||
temporary: true,
|
||||
},
|
||||
this.user.id,
|
||||
),
|
||||
);
|
||||
this.toggleResetPassword.emit();
|
||||
this._loadingService.stop();
|
||||
}
|
||||
|
||||
|
||||
@ -2132,9 +2132,6 @@
|
||||
"cancel": "Abbrechen",
|
||||
"save": "Speichern"
|
||||
},
|
||||
"error": {
|
||||
"password-policy": "Kennwort konnte nicht zurückgesetzt werden. Das neue Passwort entspricht nicht der Passwortrichtlinie."
|
||||
},
|
||||
"form": {
|
||||
"password": "Temporäres Passwort"
|
||||
},
|
||||
|
||||
@ -2132,9 +2132,6 @@
|
||||
"cancel": "Cancel",
|
||||
"save": "Save"
|
||||
},
|
||||
"error": {
|
||||
"password-policy": "Failed to reset password. The new password doesn't match the password policy."
|
||||
},
|
||||
"form": {
|
||||
"password": "Temporary password"
|
||||
},
|
||||
|
||||
@ -2132,9 +2132,6 @@
|
||||
"cancel": "Abbrechen",
|
||||
"save": "Speichern"
|
||||
},
|
||||
"error": {
|
||||
"password-policy": "Kennwort konnte nicht zurückgesetzt werden. Das neue Passwort entspricht nicht der Passwortrichtlinie."
|
||||
},
|
||||
"form": {
|
||||
"password": "Temporäres Passwort"
|
||||
},
|
||||
|
||||
@ -2132,9 +2132,6 @@
|
||||
"cancel": "Cancel",
|
||||
"save": "Save"
|
||||
},
|
||||
"error": {
|
||||
"password-policy": "Failed to reset password. The new password doesn't match the password policy."
|
||||
},
|
||||
"form": {
|
||||
"password": "Temporary password"
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user