@tap-payments/auth-jsconnect 2.8.21-test → 2.8.22-test

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.
@@ -47,10 +47,12 @@ var FormStyled = styled(Form)(function () { return ({
47
47
  flexDirection: 'column'
48
48
  }); });
49
49
  var OTP = function () {
50
+ var _a;
50
51
  var dispatch = useAppDispatch();
51
- var _a = useAppSelector(authSelector), data = _a.data, loading = _a.loading, error = _a.error;
52
+ var _b = useAppSelector(authSelector), data = _b.data, loading = _b.loading, error = _b.error;
52
53
  var t = useTranslation().t;
53
54
  var isAr = useLanguage().isAr;
55
+ var _c = ((_a = data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse) || {}, auth_type = _c.auth_type, email = _c.email, mobile = _c.mobile;
54
56
  var methods = useForm({
55
57
  resolver: yupResolver(OTPValidation),
56
58
  defaultValues: data.otpData,
@@ -59,25 +61,27 @@ var OTP = function () {
59
61
  var isNidAuth = data.otpData.authFor === AuthForType.NATIONAL_ID;
60
62
  var isEmailAuth = data.otpData.authFor === AuthForType.EMAIL;
61
63
  var getNumber = function () {
62
- var _a, _b;
64
+ var _a;
63
65
  if (isNidAuth)
64
66
  return maskID(data.nidData.nid);
65
67
  if (isEmailAuth) {
66
- var _c = ((_a = data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse) || {}, auth_type = _c.auth_type, email = _c.email, mobile = _c.mobile;
67
68
  if (auth_type === AuthTypeNumber.MOBILE_OTP && mobile)
68
69
  return mobile;
69
70
  if (auth_type === AuthTypeNumber.EMAIL_OTP && email)
70
71
  return email;
71
72
  return maskEmail(data.emailData.email);
72
73
  }
73
- var phone = data.mobileData.mobile ? ((_b = data.mobileData.countryCode) === null || _b === void 0 ? void 0 : _b.idd_prefix) + data.mobileData.mobile : '';
74
+ var phone = data.mobileData.mobile ? ((_a = data.mobileData.countryCode) === null || _a === void 0 ? void 0 : _a.idd_prefix) + data.mobileData.mobile : '';
74
75
  return maskPhone(phone);
75
76
  };
76
77
  var getTitle = function () {
77
78
  if (isNidAuth)
78
79
  return t('opt_nid_sent_title', { provider: 'ABSHER' });
79
- if (isEmailAuth)
80
- return t('otp_email_sent_title');
80
+ if (isEmailAuth) {
81
+ if (auth_type === AuthTypeNumber.EMAIL_OTP)
82
+ return t('otp_email_sent_title');
83
+ return t('ide_opt_sent_title');
84
+ }
81
85
  return t('ide_opt_sent_title');
82
86
  };
83
87
  React.useEffect(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.8.21-test",
3
+ "version": "2.8.22-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",