@tap-payments/auth-jsconnect 2.5.10-test → 2.5.12-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.
@@ -19,7 +19,7 @@ import { useTranslation } from 'react-i18next';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
20
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
21
  import { isTokenExpired } from '../../../../utils';
22
- import { resendOTP, bankSelector } from '../../../app/bank/bankStore';
22
+ import { resendOTP, bankSelector, clearError } from '../../../app/bank/bankStore';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
25
25
  return ({
@@ -36,6 +36,8 @@ var OTPInput = function (_a) {
36
36
  var dispatch = useAppDispatch();
37
37
  var error = useAppSelector(bankSelector).error;
38
38
  var handleOnOTPChange = function (otp) {
39
+ if (error)
40
+ dispatch(clearError());
39
41
  otpControl.field.onChange(otp);
40
42
  };
41
43
  var handleOnResendOTP = function () {
@@ -18,7 +18,7 @@ import { useController, useFormContext } from 'react-hook-form';
18
18
  import { useTranslation } from 'react-i18next';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
20
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
- import { brandSelector, resendOTP } from '../../../app/brand/brandStore';
21
+ import { brandSelector, clearError, resendOTP } from '../../../app/brand/brandStore';
22
22
  import { isTokenExpired } from '../../../../utils';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
@@ -36,6 +36,8 @@ var OTPInput = function (_a) {
36
36
  var dispatch = useAppDispatch();
37
37
  var error = useAppSelector(brandSelector).error;
38
38
  var handleOnOTPChange = function (otp) {
39
+ if (error)
40
+ dispatch(clearError());
39
41
  otpControl.field.onChange(otp);
40
42
  };
41
43
  var handleOnResendOTP = function () {
@@ -17,8 +17,8 @@ import Box from '@mui/material/Box/Box';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { resendOTPLeadIdentity } from '../../../app/business/businessStore';
21
- import { useAppDispatch } from '../../../../hooks';
20
+ import { businessSelector, clearError, resendOTPLeadIdentity } from '../../../app/business/businessStore';
21
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
22
22
  var BoxStyled = styled(Box)(function (_a) {
23
23
  var theme = _a.theme;
24
24
  return ({
@@ -31,8 +31,11 @@ var OTPInput = function (_a) {
31
31
  var _b = useFormContext(), control = _b.control, setValue = _b.setValue;
32
32
  var t = useTranslation().t;
33
33
  var dispatch = useAppDispatch();
34
+ var error = useAppSelector(businessSelector).error;
34
35
  var otpControl = useController({ name: 'otp', control: control });
35
36
  var handleOnOTPChange = function (otp) {
37
+ if (error)
38
+ dispatch(clearError());
36
39
  otpControl.field.onChange(otp);
37
40
  };
38
41
  var handleOnResendOTP = function () {
@@ -19,7 +19,7 @@ import { useController, useFormContext } from 'react-hook-form';
19
19
  import { useTranslation } from 'react-i18next';
20
20
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
21
21
  import { isTokenExpired } from '../../../../utils';
22
- import { businessSelector, resendOTP } from '../../../app/business/businessStore';
22
+ import { businessSelector, clearError, resendOTP } from '../../../app/business/businessStore';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
25
25
  return ({
@@ -36,6 +36,8 @@ var OTPInput = function (_a) {
36
36
  var dispatch = useAppDispatch();
37
37
  var error = useAppSelector(businessSelector).error;
38
38
  var handleOnOTPChange = function (otp) {
39
+ if (error)
40
+ dispatch(clearError());
39
41
  otpControl.field.onChange(otp);
40
42
  };
41
43
  var handleOnResendOTP = function () {
@@ -18,7 +18,7 @@ import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
20
  import { AuthForType } from '../../../../@types';
21
- import { connectSelector, resendOTPMobile, resendOTPNID } from '../../../app/connect/connectStore';
21
+ import { clearError, connectSelector, resendOTPMobile, resendOTPNID } from '../../../app/connect/connectStore';
22
22
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
23
23
  import { sendCustomEventToGTM } from '../../../../utils';
24
24
  var BoxStyled = styled(Box)(function (_a) {
@@ -34,9 +34,11 @@ var OTPInput = function (_a) {
34
34
  var t = useTranslation().t;
35
35
  var dispatch = useAppDispatch();
36
36
  var otpControl = useController({ name: 'otp', control: control });
37
- var data = useAppSelector(connectSelector).data;
37
+ var _c = useAppSelector(connectSelector), data = _c.data, error = _c.error;
38
38
  var startWithNID = data.otpData.authFor === AuthForType.NATIONAL_ID;
39
39
  var handleOnOTPChange = function (otp) {
40
+ if (error)
41
+ dispatch(clearError());
40
42
  otpControl.field.onChange(otp);
41
43
  };
42
44
  var sendEventAskAnotherOTP = function () {
@@ -18,7 +18,7 @@ import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
20
  import { AuthForType } from '../../../../@types';
21
- import { resendNIDAuthIdentityOTP, connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
21
+ import { resendNIDAuthIdentityOTP, connectExpressSelector, clearError } from '../../../app/connectExpress/connectExpressStore';
22
22
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
@@ -33,10 +33,12 @@ var OTPInput = function (_a) {
33
33
  var t = useTranslation().t;
34
34
  var dispatch = useAppDispatch();
35
35
  var otpControl = useController({ name: 'otp', control: control });
36
- var data = useAppSelector(connectExpressSelector).data;
36
+ var _c = useAppSelector(connectExpressSelector), data = _c.data, error = _c.error;
37
37
  var nidData = data.nidData;
38
38
  var isNidAuth = data.otpData.authFor === AuthForType.NATIONAL_ID;
39
39
  var handleOnOTPChange = function (otp) {
40
+ if (error)
41
+ dispatch(clearError());
40
42
  otpControl.field.onChange(otp);
41
43
  };
42
44
  var handleOnResendOTP = function () {
@@ -18,7 +18,7 @@ import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
20
  import { AuthForType } from '../../../../@types';
21
- import { resendMobileAuthOTP, resendNIDAuthOTP, connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
21
+ import { resendMobileAuthOTP, resendNIDAuthOTP, connectExpressSelector, clearError } from '../../../app/connectExpress/connectExpressStore';
22
22
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
@@ -33,10 +33,12 @@ var OTPInput = function (_a) {
33
33
  var t = useTranslation().t;
34
34
  var dispatch = useAppDispatch();
35
35
  var otpControl = useController({ name: 'otp', control: control });
36
- var data = useAppSelector(connectExpressSelector).data;
36
+ var _c = useAppSelector(connectExpressSelector), data = _c.data, error = _c.error;
37
37
  var mobileData = data.mobileData, nidData = data.nidData, responseData = data.responseData;
38
38
  var isNidAuth = data.otpData.authFor === AuthForType.NATIONAL_ID;
39
39
  var handleOnOTPChange = function (otp) {
40
+ if (error)
41
+ dispatch(clearError());
40
42
  otpControl.field.onChange(otp);
41
43
  };
42
44
  var handleOnResendOTP = function () {
@@ -19,7 +19,7 @@ import { useTranslation } from 'react-i18next';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
20
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
21
  import { isTokenExpired } from '../../../../utils';
22
- import { entitySelector, resendOTP } from '../../../app/entity/entityStore';
22
+ import { clearError, entitySelector, resendOTP } from '../../../app/entity/entityStore';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
25
25
  return ({
@@ -36,6 +36,8 @@ var OTPInput = function (_a) {
36
36
  var dispatch = useAppDispatch();
37
37
  var error = useAppSelector(entitySelector).error;
38
38
  var handleOnOTPChange = function (otp) {
39
+ if (error)
40
+ dispatch(clearError());
39
41
  otpControl.field.onChange(otp);
40
42
  };
41
43
  var handleOnResendOTP = function () {
@@ -19,7 +19,7 @@ import { useController, useFormContext } from 'react-hook-form';
19
19
  import { useTranslation } from 'react-i18next';
20
20
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
21
21
  import { isTokenExpired } from '../../../../utils';
22
- import { individualSelector, resendOTP } from '../../../app/individual/individualStore';
22
+ import { clearError, individualSelector, resendOTP } from '../../../app/individual/individualStore';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
25
25
  return ({
@@ -36,6 +36,8 @@ var OTPInput = function (_a) {
36
36
  var dispatch = useAppDispatch();
37
37
  var error = useAppSelector(individualSelector).error;
38
38
  var handleOnOTPChange = function (otp) {
39
+ if (error)
40
+ dispatch(clearError());
39
41
  otpControl.field.onChange(otp);
40
42
  };
41
43
  var handleOnResendOTP = function () {
@@ -17,8 +17,8 @@ import Box from '@mui/material/Box/Box';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { useAppDispatch } from '../../../../hooks';
21
- import { resendOperationOTP } from '../../../../features/app/password/passwordStore';
20
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
+ import { clearError, passwordSelector, resendOperationOTP } from '../../../../features/app/password/passwordStore';
22
22
  var BoxStyled = styled(Box)(function (_a) {
23
23
  var theme = _a.theme;
24
24
  return ({
@@ -32,7 +32,10 @@ var OTPInput = function (_a) {
32
32
  var t = useTranslation().t;
33
33
  var dispatch = useAppDispatch();
34
34
  var otpControl = useController({ name: 'otp', control: control });
35
+ var error = useAppSelector(passwordSelector).error;
35
36
  var handleOnOTPChange = function (otp) {
37
+ if (error)
38
+ dispatch(clearError());
36
39
  otpControl.field.onChange(otp);
37
40
  };
38
41
  var handleOnResendOTP = function () {
@@ -19,7 +19,7 @@ import { useController, useFormContext } from 'react-hook-form';
19
19
  import { useTranslation } from 'react-i18next';
20
20
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
21
21
  import { isTokenExpired } from '../../../../utils';
22
- import { passwordSelector, resendOTP } from '../../../app/password/passwordStore';
22
+ import { clearError, passwordSelector, resendOTP } from '../../../app/password/passwordStore';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
25
25
  return ({
@@ -36,6 +36,8 @@ var OTPInput = function (_a) {
36
36
  var dispatch = useAppDispatch();
37
37
  var error = useAppSelector(passwordSelector).error;
38
38
  var handleOnOTPChange = function (otp) {
39
+ if (error)
40
+ dispatch(clearError());
39
41
  otpControl.field.onChange(otp);
40
42
  };
41
43
  var handleOnResendOTP = function () {
@@ -17,7 +17,7 @@ import Box from '@mui/material/Box/Box';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { signInSelector, resendOTPMobile, resendOTPEmail } from '../../../app/signIn/signInStore';
20
+ import { signInSelector, resendOTPMobile, resendOTPEmail, clearError } from '../../../app/signIn/signInStore';
21
21
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
22
22
  var BoxStyled = styled(Box)(function (_a) {
23
23
  var theme = _a.theme;
@@ -32,9 +32,11 @@ var OTPInput = function (_a) {
32
32
  var t = useTranslation().t;
33
33
  var dispatch = useAppDispatch();
34
34
  var otpControl = useController({ name: 'otp', control: control });
35
- var data = useAppSelector(signInSelector).data;
35
+ var _c = useAppSelector(signInSelector), data = _c.data, error = _c.error;
36
36
  var isEmail = !!data.auth.email;
37
37
  var handleOnOTPChange = function (otp) {
38
+ if (error)
39
+ dispatch(clearError());
38
40
  otpControl.field.onChange(otp);
39
41
  };
40
42
  var handleOnResendOTP = function () {
@@ -19,7 +19,7 @@ import { useController, useFormContext } from 'react-hook-form';
19
19
  import { useTranslation } from 'react-i18next';
20
20
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
21
21
  import { isTokenExpired } from '../../../../utils';
22
- import { resendOTP, taxSelector } from '../../../app/tax/taxStore';
22
+ import { clearError, resendOTP, taxSelector } from '../../../app/tax/taxStore';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
25
25
  return ({
@@ -36,6 +36,8 @@ var OTPInput = function (_a) {
36
36
  var dispatch = useAppDispatch();
37
37
  var error = useAppSelector(taxSelector).error;
38
38
  var handleOnOTPChange = function (otp) {
39
+ if (error)
40
+ dispatch(clearError());
39
41
  otpControl.field.onChange(otp);
40
42
  };
41
43
  var handleOnResendOTP = function () {
@@ -11,14 +11,10 @@ export var dangerousMessage = function (message, callBack) {
11
11
  callBack === null || callBack === void 0 ? void 0 : callBack({ message: message });
12
12
  };
13
13
  export var setBaseUrl = function (publicKey) {
14
- if (process.env.NODE_ENV === 'development') {
15
- axiosInstance.defaults.baseURL = ENDPOINT_PATHS.DEV_BASE_URL;
16
- return;
17
- }
18
14
  var isProd = publicKey.includes('pk_live');
19
15
  if (isProd) {
20
16
  axiosInstance.defaults.baseURL = ENDPOINT_PATHS.PRODUCTION_BASE_URL;
21
17
  return;
22
18
  }
23
- axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
19
+ axiosInstance.defaults.baseURL = ENDPOINT_PATHS.DEV_BASE_URL;
24
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.5.10-test",
3
+ "version": "2.5.12-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",