@snabcentr/client-ui 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1609,10 +1609,16 @@ class ScSignInFormByEmailComponent {
|
|
|
1609
1609
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
1610
1610
|
catchError((error) => {
|
|
1611
1611
|
if (error instanceof HttpErrorResponse) {
|
|
1612
|
+
console.log(error);
|
|
1612
1613
|
if ('error' in error.error) {
|
|
1613
1614
|
const errorResponse = error.error;
|
|
1614
1615
|
if (errorResponse.error.includes('invalid_grant')) {
|
|
1615
|
-
|
|
1616
|
+
if (errorResponse.errorDescription?.toLocaleLowerCase().includes('invalid')) {
|
|
1617
|
+
this.formByEmail.setErrors({ serverResponse: ['Неверный адрес электронной почты или пароль. Проверьте правильность ввода.'] });
|
|
1618
|
+
}
|
|
1619
|
+
if (errorResponse.errorDescription?.toLocaleLowerCase().includes('disabled')) {
|
|
1620
|
+
this.formByEmail.setErrors({ serverResponse: ['Учетная запись заблокирована, свяжитесь с администратором.'] });
|
|
1621
|
+
}
|
|
1616
1622
|
}
|
|
1617
1623
|
else {
|
|
1618
1624
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
@@ -1697,6 +1703,10 @@ class ScSignInFormByPhoneComponent {
|
|
|
1697
1703
|
* {@link Subject} события отправки формы.
|
|
1698
1704
|
*/
|
|
1699
1705
|
this.onSubmit = new Subject();
|
|
1706
|
+
/**
|
|
1707
|
+
* Сервис для отображения Push-уведомлений с контактами для помощи клиенту.
|
|
1708
|
+
*/
|
|
1709
|
+
this.helpNotificationService = inject(ScHelpNotificationService);
|
|
1700
1710
|
/**
|
|
1701
1711
|
* {@link Observable} запроса данных аутентификации.
|
|
1702
1712
|
*/
|
|
@@ -1706,8 +1716,12 @@ class ScSignInFormByPhoneComponent {
|
|
|
1706
1716
|
if (error instanceof HttpErrorResponse) {
|
|
1707
1717
|
if ('error' in error.error) {
|
|
1708
1718
|
const errorResponse = error.error;
|
|
1709
|
-
if (errorResponse.error.includes('invalid_credentials')) {
|
|
1710
|
-
this.form.setErrors({ serverResponse: ['Неверный
|
|
1719
|
+
if (errorResponse.error.includes('invalid_credentials') && errorResponse.errorDescription?.toLocaleLowerCase().includes('invalid')) {
|
|
1720
|
+
this.form.get('verificationCode')?.setErrors({ serverResponse: ['Неверный СМС-код подтверждения.'] });
|
|
1721
|
+
}
|
|
1722
|
+
else if (errorResponse.error.includes('invalid_grant') && errorResponse.errorDescription?.toLocaleLowerCase().includes('disabled')) {
|
|
1723
|
+
this.form.setErrors({ serverResponse: ['Учетная запись заблокирована, свяжитесь с администратором.'] });
|
|
1724
|
+
this.helpNotificationService.helpNotificationByPhone(value.phone);
|
|
1711
1725
|
}
|
|
1712
1726
|
else {
|
|
1713
1727
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|