Sécurisation du wallet

This commit is contained in:
Brice Zele 2022-04-21 12:14:21 +01:00
parent 441726e561
commit f7679e4f14
15 changed files with 1463 additions and 1201 deletions

View File

@ -129,6 +129,7 @@ android {
pickFirst 'lib/armeabi-v7a/libc++_shared.so' pickFirst 'lib/armeabi-v7a/libc++_shared.so'
} }
lintOptions { checkReleaseBuilds false } lintOptions { checkReleaseBuilds false }
ndkVersion rootProject.ext.ndkVersion
compileSdkVersion rootProject.ext.compileSdkVersion compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions { compileOptions {

File diff suppressed because one or more lines are too long

View File

@ -4,6 +4,7 @@ buildscript {
minSdkVersion = 16 minSdkVersion = 16
compileSdkVersion = 29 compileSdkVersion = 29
targetSdkVersion = 29 targetSdkVersion = 29
ndkVersion = "21.4.7075529"
} }
repositories { repositories {
google() google()

View File

@ -15,6 +15,10 @@ import {
LINK_CARD_PENDING, LINK_CARD_PENDING,
LINK_CARD_RESET, LINK_CARD_RESET,
LINK_CARD_SUCCESS, LINK_CARD_SUCCESS,
PASSWORD_VALIDATION_ERROR,
PASSWORD_VALIDATION_PENDING,
PASSWORD_VALIDATION_RESET,
PASSWORD_VALIDATION_SUCCESS,
PAY_BILL_ERROR, PAY_BILL_ERROR,
PAY_BILL_PENDING, PAY_BILL_PENDING,
PAY_BILL_RESET, PAY_BILL_RESET,
@ -319,3 +323,21 @@ export const fetchGetQRCodeDetailError = (error) => ({
type: GET_QR_CODE_DETAIL_ERROR, type: GET_QR_CODE_DETAIL_ERROR,
result: error result: error
}); });
/**
* ---------------------------------------------------
*/
export const fetchPasswordValidationPending = () => ({
type: PASSWORD_VALIDATION_PENDING
});
export const fetchPasswordValidationReset = () => ({
type: PASSWORD_VALIDATION_RESET
});
export const fetchPasswordValidationSuccess = (res) => ({
type: PASSWORD_VALIDATION_SUCCESS,
result: res,
});
export const fetchPasswordValidationError = (error) => ({
type: PASSWORD_VALIDATION_ERROR,
result: error
});

View File

@ -0,0 +1,44 @@
/**
* @Project iLinkWorld
* @File PasswordValidationReducer.js
* @Path redux/reducers
* @Author BRICE ZELE
* @Date 21/04/2022
*/
import * as WalletType from "../types/WalletType";
const initialState = {
loading: false,
result: null,
error: null
};
export default (state = initialState, action) => {
switch (action.type) {
case WalletType.PASSWORD_VALIDATION_PENDING:
return {
...state,
loading: true
}
case WalletType.PASSWORD_VALIDATION_SUCCESS:
return {
...state,
loading: false,
result: action.result.data,
error: null
}
case WalletType.PASSWORD_VALIDATION_ERROR:
return {
...state,
loading: false,
result: null,
error: action.result.data.error
}
case WalletType.PASSWORD_VALIDATION_RESET:
return initialState;
default: {
return state;
}
}
};

View File

@ -80,6 +80,7 @@ import {
} from "../insurance/insurance.reducer"; } from "../insurance/insurance.reducer";
import SearchUserReducer from "./SearchUserReducer"; import SearchUserReducer from "./SearchUserReducer";
import GetQRCodeDetailReducer from "./GetQRCodeDetailReducer"; import GetQRCodeDetailReducer from "./GetQRCodeDetailReducer";
import PasswordValidationReducer from "./PasswordValidationReducer";
const persistConfig = { const persistConfig = {
key: 'root', key: 'root',
@ -193,6 +194,7 @@ const rootReducer = persistCombineReducers(persistConfig, {
checkInsuranceCoverageAmountReducer: checkInsuranceCoverageAmountReducer, checkInsuranceCoverageAmountReducer: checkInsuranceCoverageAmountReducer,
searchUserReducer: SearchUserReducer, searchUserReducer: SearchUserReducer,
getQRCodeDetailReducer: GetQRCodeDetailReducer, getQRCodeDetailReducer: GetQRCodeDetailReducer,
passwordValidationReducer: PasswordValidationReducer,
getExclusionReducer: getExclusionReducer getExclusionReducer: getExclusionReducer
}); });

View File

@ -68,3 +68,8 @@ export const GET_QR_CODE_DETAIL_PENDING = 'GET_QR_CODE_DETAIL_PENDING';
export const GET_QR_CODE_DETAIL_SUCCESS = 'GET_QR_CODE_DETAIL_SUCCESS'; export const GET_QR_CODE_DETAIL_SUCCESS = 'GET_QR_CODE_DETAIL_SUCCESS';
export const GET_QR_CODE_DETAIL_ERROR = 'GET_QR_CODE_DETAIL_ERROR'; export const GET_QR_CODE_DETAIL_ERROR = 'GET_QR_CODE_DETAIL_ERROR';
export const GET_QR_CODE_DETAIL_RESET = 'GET_QR_CODE_DETAIL_RESET'; export const GET_QR_CODE_DETAIL_RESET = 'GET_QR_CODE_DETAIL_RESET';
export const PASSWORD_VALIDATION_PENDING = 'PASSWORD_VALIDATION_PENDING';
export const PASSWORD_VALIDATION_SUCCESS = 'PASSWORD_VALIDATION_SUCCESS';
export const PASSWORD_VALIDATION_ERROR = 'PASSWORD_VALIDATION_ERROR';
export const PASSWORD_VALIDATION_RESET = 'PASSWORD_VALIDATION_RESET';

View File

@ -52,7 +52,12 @@ import {
} from '../../utils/UtilsFunction'; } from '../../utils/UtilsFunction';
import {depositActionReset} from '../../webservice/DepositApi'; import {depositActionReset} from '../../webservice/DepositApi';
import {baseUrl} from '../../webservice/IlinkConstants'; import {baseUrl} from '../../webservice/IlinkConstants';
import {getWalletDetailActivated, resetWalletListDetailReducer} from '../../webservice/WalletApi'; import {
getWalletDetailActivated,
passwordValidationAction,
passwordValidationReset,
resetWalletListDetailReducer
} from '../../webservice/WalletApi';
import { import {
getHyperSuperTransactionHistoryAction, getHyperSuperTransactionHistoryAction,
getHyperSuperTransactionHistoryReset, getHyperSuperTransactionHistoryReset,
@ -73,6 +78,11 @@ import {
fetchGetUserByNameOrNumberReset fetchGetUserByNameOrNumberReset
} from "../../redux/insurance/insurance.actions"; } from "../../redux/insurance/insurance.actions";
import {facturerSoinReset} from "../../webservice/NanoCreditApi"; import {facturerSoinReset} from "../../webservice/NanoCreditApi";
import FontAwesomeIcon from "react-native-vector-icons/FontAwesome";
import * as Animatable from 'react-native-animatable';
import {Fumi} from 'react-native-textinput-effects';
import Button from "../../components/Button";
let moment = require('moment-timezone'); let moment = require('moment-timezone');
const thousands = require('thousands'); const thousands = require('thousands');
@ -101,7 +111,9 @@ class WalletDetail extends Component {
displayModalHistory: false, displayModalHistory: false,
displaySuperHyperModalHistory: false, displaySuperHyperModalHistory: false,
historyItemDetail: null, historyItemDetail: null,
user: null user: null,
password: '',
isLogged: false
}; };
this.renderContent = null; this.renderContent = null;
@ -129,6 +141,7 @@ class WalletDetail extends Component {
this.props.fetchGetConsultationReset(); this.props.fetchGetConsultationReset();
this.props.fetchGetNetworkActsReset(); this.props.fetchGetNetworkActsReset();
this.props.facturerSoinReset(); this.props.facturerSoinReset();
this.props.passwordValidationReset();
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb"; this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale); moment.locale(this.currentLocale);
@ -346,17 +359,44 @@ class WalletDetail extends Component {
} }
} }
/* componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
if (nextProps.resultPasswordValidation !== null) {
if (nextProps.resultPasswordValidation.status === 200) {
this.setState({
isLogged: true
});
this.props.passwordValidationReset();
}
}
if (nextProps.errorPasswordValidation !== null) {
console.log(nextProps.errorPasswordValidation);
Alert.alert(
I18n.t("ERROR_LABEL"),
'' + nextProps.errorPasswordValidation,
[
{
text: I18n.t("OK"), onPress: () => {
this.props.passwordValidationReset();
}
}
],
{cancelable: false}
);
this.setState({
isLogged: false
});
}
if (nextProps.loading || nextProps.loadingTransferCommission) /* if (nextProps.loading || nextProps.loadingTransferCommission)
this.setState({ this.setState({
loading: true loading: true
}) })
else else
this.setState({ this.setState({
loading: false loading: false
}) })*/
} */ }
getWalletIcon = (wallet) => { getWalletIcon = (wallet) => {
return `${baseUrl}/datas/img/network/${slugify(wallet.network, {lower: true})}-logo.png`; return `${baseUrl}/datas/img/network/${slugify(wallet.network, {lower: true})}-logo.png`;
@ -1495,6 +1535,7 @@ class WalletDetail extends Component {
) )
else { else {
return ( return (
<>
<View key={index} style={styles.transactionContainer}> <View key={index} style={styles.transactionContainer}>
{this.renderItem(item[0], false, 0)} {this.renderItem(item[0], false, 0)}
<> <>
@ -1507,11 +1548,11 @@ class WalletDetail extends Component {
source: require("./../../datas/json/identification.json"), source: require("./../../datas/json/identification.json"),
loop: true loop: true
} }
}) });
}} }}
activeOpacity={0.9}> activeOpacity={0.9}>
<Icon name='pencil-plus' <Icon name='history'
color={Color.primaryColor} color={Color.primaryColor}
size={30} size={30}
style={styles.imageBanner}/> style={styles.imageBanner}/>
@ -1537,6 +1578,43 @@ class WalletDetail extends Component {
</View> </View>
</> </>
</View> </View>
<View key={index} style={styles.transactionContainer}>
<>
<View style={[styles.containerTouch]}>
<TouchableOpacity style={styles.contain}
onPress={() => {
this.props.navigation.push(route.historiqueNanoSanteAgentScreen);
}}
activeOpacity={0.9}>
<Icon name='pencil-plus'
color={Color.primaryColor}
size={30}
style={styles.imageBanner}/>
<View style={[styles.content]}>
<View style={styles.contentTitle}>
<Text
style={[Typography.headline, Typography.semibold]}>
{I18n.t('HISTORY')}
</Text>
</View>
<View style={{flex: 1}}>
<Text
style={[Typography.overline, Color.grayColor], {paddingVertical: 5}}
numberOfLines={5}>
</Text>
</View>
</View>
</TouchableOpacity>
</View>
<View/>
</>
</View>
</>
) )
} }
}) })
@ -2058,6 +2136,39 @@ class WalletDetail extends Component {
</View> </View>
: :
this.props.result.response.password_validation === "MIN" && !this.state.isLogged ?
<ScrollView style={{flex: 1, padding: 20}}>
<Animatable.View ref={(comp) => {
this.codeAgentAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon}
label={I18n.t('PASSWORD')}
iconColor={'#f95a25'}
iconSize={20}
secureTextEntry
iconName="lock"
value={this.state.password}
onChangeText={(password) => {
this.setState({password});
}}
style={styles.input}
>
</Fumi>
</Animatable.View>
<Button
loading={this.props.loadingPasswordValidation}
onPress={() => {
this.props.passwordValidationAction({
password: this.state.password,
user_id: this.props.navigation.state.params.agentId,
network_agent_id: this.props.result.response.network_agent_id
});
}}>
{I18n.t('SUBMIT_LABEL')}
</Button>
</ScrollView>
:
this.renderDetailWallet(this.props.result.response) this.renderDetailWallet(this.props.result.response)
: :
null null
@ -2088,6 +2199,10 @@ const mapStateToProps = state => ({
loadingHistoryHyperSuper: state.getHyperSuperHistoryReducer.loading, loadingHistoryHyperSuper: state.getHyperSuperHistoryReducer.loading,
resultHistoryHyperSuper: state.getHyperSuperHistoryReducer.result, resultHistoryHyperSuper: state.getHyperSuperHistoryReducer.result,
errorHistoryHyperSuper: state.getHyperSuperHistoryReducer.error, errorHistoryHyperSuper: state.getHyperSuperHistoryReducer.error,
loadingPasswordValidation: state.passwordValidationReducer.loading,
resultPasswordValidation: state.passwordValidationReducer.result,
errorPasswordValidation: state.passwordValidationReducer.error,
}); });
const mapDispatchToProps = dispatch => bindActionCreators({ const mapDispatchToProps = dispatch => bindActionCreators({
@ -2100,6 +2215,9 @@ const mapDispatchToProps = dispatch => bindActionCreators({
depositActionReset, depositActionReset,
getHyperSuperTransactionHistoryAction, getHyperSuperTransactionHistoryAction,
getHyperSuperTransactionHistoryReset, getHyperSuperTransactionHistoryReset,
passwordValidationAction,
passwordValidationReset,
fetchGetSubscriptionListReset, fetchGetSubscriptionListReset,
fetchGetDrugAppareilReset, fetchGetDrugAppareilReset,
@ -2121,6 +2239,13 @@ const styles = StyleSheet.create({
indicator: { indicator: {
height: 2 height: 2
}, },
input: {
height: 60,
width: '100%',
borderRadius: 5,
borderWidth: 0.5,
marginBottom: 20,
},
tab: { tab: {
width: Utils.getWidthDevice() / 2 width: Utils.getWidthDevice() / 2
}, },
@ -2191,6 +2316,14 @@ const styles = StyleSheet.create({
paddingVertical: 10, paddingVertical: 10,
marginTop: 5 marginTop: 5
}, },
btnvalide: {
marginTop: 20,
marginLeft: 20,
marginRight: 20,
borderColor: 'transparent',
backgroundColor: Color.accentLightColor,
height: 52
},
blockView: { blockView: {
paddingVertical: 10, paddingVertical: 10,
borderBottomWidth: 0.5, borderBottomWidth: 0.5,

View File

@ -521,8 +521,7 @@ const ExecuterPrescriptionScreen = ({
const ExecuterPrescriptionSchema = Yup.object().shape({ const ExecuterPrescriptionSchema = Yup.object().shape({
numero_assure: Yup.string() numero_assure: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
password: Yup.string() password: Yup.string(),
.required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_lastname: Yup.string() practitioner_lastname: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_firstname: Yup.string() practitioner_firstname: Yup.string()
@ -1632,6 +1631,9 @@ const ExecuterPrescriptionScreen = ({
/> />
</Animatable.View> </Animatable.View>
{
wallet.password_validation === "MAX" &&
<TextInput <TextInput
style={{marginTop: 10}} style={{marginTop: 10}}
placeholder={I18n.t('PASSWORD')} placeholder={I18n.t('PASSWORD')}
@ -1643,6 +1645,7 @@ const ExecuterPrescriptionScreen = ({
error={errors.password} error={errors.password}
secureTextEntry secureTextEntry
/> />
}
<View <View
style={{ style={{

View File

@ -531,8 +531,7 @@ const ModifierExecutionPrescriptionScreen = ({
const ExecuterPrescriptionSchema = Yup.object().shape({ const ExecuterPrescriptionSchema = Yup.object().shape({
numero_assure: Yup.string() numero_assure: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
password: Yup.string() password: Yup.string(),
.required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_lastname: Yup.string() practitioner_lastname: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_firstname: Yup.string() practitioner_firstname: Yup.string()
@ -1617,6 +1616,8 @@ const ModifierExecutionPrescriptionScreen = ({
/> />
</Animatable.View> </Animatable.View>
{
wallet.password_validation === "MAX" &&
<TextInput <TextInput
style={{marginTop: 10}} style={{marginTop: 10}}
placeholder={I18n.t('PASSWORD')} placeholder={I18n.t('PASSWORD')}
@ -1628,6 +1629,7 @@ const ModifierExecutionPrescriptionScreen = ({
error={errors.password} error={errors.password}
secureTextEntry secureTextEntry
/> />
}
<View <View
style={{ style={{

View File

@ -598,8 +598,7 @@ const ModifierFeuilleSoinScreen = ({
const ModifierFeuilleSoinSchema = Yup.object().shape({ const ModifierFeuilleSoinSchema = Yup.object().shape({
numero_assure: Yup.string() numero_assure: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
password: Yup.string() password: Yup.string(),
.required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_lastname: Yup.string() practitioner_lastname: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_firstname: Yup.string() practitioner_firstname: Yup.string()
@ -3004,6 +3003,8 @@ const ModifierFeuilleSoinScreen = ({
) )
} }
{
wallet.password_validation === "MAX" &&
<TextInput <TextInput
style={{marginTop: 10}} style={{marginTop: 10}}
placeholder={I18n.t('PASSWORD')} placeholder={I18n.t('PASSWORD')}
@ -3015,6 +3016,7 @@ const ModifierFeuilleSoinScreen = ({
error={errors.password} error={errors.password}
secureTextEntry secureTextEntry
/> />
}
<View <View
style={{ style={{

View File

@ -679,8 +679,7 @@ const SaisirFeuilleSoinScreen = ({
const SaisirFeuilleSoinSchema = Yup.object().shape({ const SaisirFeuilleSoinSchema = Yup.object().shape({
numero_assure: Yup.string() numero_assure: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
password: Yup.string() password: Yup.string(),
.required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_lastname: Yup.string() practitioner_lastname: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_firstname: Yup.string() practitioner_firstname: Yup.string()
@ -2057,6 +2056,8 @@ const SaisirFeuilleSoinScreen = ({
) )
} }
{
wallet.password_validation === "MAX" &&
<TextInput <TextInput
style={{marginTop: 10}} style={{marginTop: 10}}
placeholder={I18n.t('PASSWORD')} placeholder={I18n.t('PASSWORD')}
@ -2068,6 +2069,7 @@ const SaisirFeuilleSoinScreen = ({
error={errors.password} error={errors.password}
secureTextEntry secureTextEntry
/> />
}
<View <View
style={{ style={{

View File

@ -58,7 +58,6 @@ import {useFormik} from "formik";
import * as Animatable from "react-native-animatable"; import * as Animatable from "react-native-animatable";
import {responsiveWidth} from "react-native-responsive-dimensions"; import {responsiveWidth} from "react-native-responsive-dimensions";
import {Dropdown} from "react-native-material-dropdown"; import {Dropdown} from "react-native-material-dropdown";
import PasswordInput from "../../../components/PasswordInput";
import FontAwesome from "react-native-vector-icons/FontAwesome"; import FontAwesome from "react-native-vector-icons/FontAwesome";
import Button from "../../../components/Button"; import Button from "../../../components/Button";
import * as Yup from "yup"; import * as Yup from "yup";
@ -137,7 +136,6 @@ const DemandeAutorisationSoinScreen = ({
const RegisterSchema = Yup.object().shape({ const RegisterSchema = Yup.object().shape({
password: Yup.string() password: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED'))
}); });
useEffect(() => { useEffect(() => {
@ -745,7 +743,9 @@ const DemandeAutorisationSoinScreen = ({
/> />
</Animatable.View> </Animatable.View>
<PasswordInput {
wallet.password_validation === "MAX" &&
<TextInput
style={{marginTop: 10, width: responsiveWidth(90)}} style={{marginTop: 10, width: responsiveWidth(90)}}
onChangeText={handleChange('password')} onChangeText={handleChange('password')}
placeholder={I18n.t('PASSWORD')} placeholder={I18n.t('PASSWORD')}
@ -757,6 +757,7 @@ const DemandeAutorisationSoinScreen = ({
touched={touched.password} touched={touched.password}
error={errors.password} error={errors.password}
/> />
}
<Button <Button
style={{marginTop: 20}} style={{marginTop: 20}}

View File

@ -102,6 +102,7 @@ export const getNetworkActsUrl = testBaseUrl + '/nanoSanteService/acts';
export const createConsultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/consultation'; export const createConsultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/consultation';
export const executionPrescriptionUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/execution'; export const executionPrescriptionUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/execution';
export const consultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets'; export const consultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets';
export const passwordValidationUrl = testBaseUrl + '/nanoSanteService/password-validation';
export const getAmountConsultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/performances-amount'; export const getAmountConsultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/performances-amount';
export const getInsurancePrimeAmountUrl = testBaseUrl + '/nanoSanteService/insurances/subscriptions/bonus-amount'; export const getInsurancePrimeAmountUrl = testBaseUrl + '/nanoSanteService/insurances/subscriptions/bonus-amount';
export const autorisationCareRequestUrl = testBaseUrl + '/nanoSanteService/authorizations-care-requests'; export const autorisationCareRequestUrl = testBaseUrl + '/nanoSanteService/authorizations-care-requests';

View File

@ -5,6 +5,7 @@ import {
getQRCodeDetail, getQRCodeDetail,
linkBankAccountUrl, linkBankAccountUrl,
linkCardUrl, linkCardUrl,
passwordValidationUrl,
payBillUrl, payBillUrl,
searchUserHomeUrl, searchUserHomeUrl,
searchUserUrl, searchUserUrl,
@ -29,6 +30,10 @@ import {
fetchLinkCardPending, fetchLinkCardPending,
fetchLinkCardReset, fetchLinkCardReset,
fetchLinkCardSuccess, fetchLinkCardSuccess,
fetchPasswordValidationError,
fetchPasswordValidationPending,
fetchPasswordValidationReset,
fetchPasswordValidationSuccess,
fetchPayBillError, fetchPayBillError,
fetchPayBillPending, fetchPayBillPending,
fetchPayBillReset, fetchPayBillReset,
@ -436,3 +441,40 @@ export const getQRCodeDetailReset = () => {
dispatch(fetchGetQRCodeDetailReset()); dispatch(fetchGetQRCodeDetailReset());
} }
}; };
export const passwordValidationAction = (data) => {
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
return dispatch => {
dispatch(fetchPasswordValidationPending());
axios({
url: `${passwordValidationUrl}`,
method: 'POST',
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
},
data
})
.then(response => {
console.log(response);
dispatch(fetchPasswordValidationSuccess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchPasswordValidationError(error.response));
else if (error.request)
dispatch(fetchPasswordValidationError(error.request));
else
dispatch(fetchPasswordValidationError(error.message));
});
}
}
export const passwordValidationReset = () => {
return dispatch => {
dispatch(fetchPasswordValidationReset());
}
};