RED-8209: fixed wrong error message upon password reset.

This commit is contained in:
Nicoleta Panaghiu 2024-01-16 15:18:10 +02:00
parent ee3dd12f80
commit 92bf6228a7
5 changed files with 11 additions and 29 deletions

View File

@ -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();
}

View File

@ -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"
},

View File

@ -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"
},

View File

@ -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"
},

View File

@ -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"
},