Commit aa69d1d2 by Giang Tran

fix bug chang password

parent 3b82aa35
...@@ -16,7 +16,12 @@ import { ...@@ -16,7 +16,12 @@ import {
useBlurOnFulfill, useBlurOnFulfill,
useClearByFocusCell, useClearByFocusCell,
} from 'react-native-confirmation-code-field'; } from 'react-native-confirmation-code-field';
import {getFontXD, HEIGHTXD, WIDTHXD} from '../../Config/Functions'; import {
getFontXD,
HEIGHTXD,
WIDTHXD,
encryptRSAString,
} from '../../Config/Functions';
import R from '../../assets/R'; import R from '../../assets/R';
import {NEWPASSWORD} from '../../routers/ScreenNames'; import {NEWPASSWORD} from '../../routers/ScreenNames';
import {verifyOTPApi} from '../../apis/Functions/users'; import {verifyOTPApi} from '../../apis/Functions/users';
...@@ -70,7 +75,7 @@ const ConfirmOTP = (propsa) => { ...@@ -70,7 +75,7 @@ const ConfirmOTP = (propsa) => {
const res = await verifyOTPApi({ const res = await verifyOTPApi({
platform: Platform.OS, platform: Platform.OS,
receiver_name: propsa.route.params.email, receiver_name: propsa.route.params.email,
otp: value, otp: encryptRSAString(value),
type: 'FORGOT_PASSWORD', type: 'FORGOT_PASSWORD',
}); });
......
...@@ -12,7 +12,12 @@ import HeaderBack from '../../components/Header/HeaderBack'; ...@@ -12,7 +12,12 @@ import HeaderBack from '../../components/Header/HeaderBack';
import {forgotPasswordApi} from '../../apis/Functions/users'; import {forgotPasswordApi} from '../../apis/Functions/users';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import {getFontXD, HEIGHTXD, WIDTHXD} from '../../Config/Functions'; import {
getFontXD,
HEIGHTXD,
WIDTHXD,
encryptRSAString,
} from '../../Config/Functions';
import R from '../../assets/R'; import R from '../../assets/R';
import {AUTHEN} from '../../routers/ScreenNames'; import {AUTHEN} from '../../routers/ScreenNames';
import I18n from '../../helper/i18/i18n'; import I18n from '../../helper/i18/i18n';
...@@ -20,7 +25,6 @@ import I18n from '../../helper/i18/i18n'; ...@@ -20,7 +25,6 @@ import I18n from '../../helper/i18/i18n';
import {showLoading, hideLoading} from '../../actions/loadingAction'; import {showLoading, hideLoading} from '../../actions/loadingAction';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {showAlert, TYPE} from '../../components/DropdownAlert'; import {showAlert, TYPE} from '../../components/DropdownAlert';
import {encryptRSAString} from '../../Config/Functions';
const NewPassword = (props) => { const NewPassword = (props) => {
const [password, setPassword] = useState(''); const [password, setPassword] = useState('');
...@@ -36,7 +40,7 @@ const NewPassword = (props) => { ...@@ -36,7 +40,7 @@ const NewPassword = (props) => {
props.showLoading(); props.showLoading();
const res = await forgotPasswordApi({ const res = await forgotPasswordApi({
receiver_name: email, receiver_name: email,
otp, otp: encryptRSAString(otp),
password: encryptRSAString(password), password: encryptRSAString(password),
password_confirmation: encryptRSAString(cfPassword), password_confirmation: encryptRSAString(cfPassword),
platform: Platform.OS, platform: Platform.OS,
...@@ -54,7 +58,7 @@ const NewPassword = (props) => { ...@@ -54,7 +58,7 @@ const NewPassword = (props) => {
I18n.t('ChangePasswordSuccess'), I18n.t('ChangePasswordSuccess'),
); );
} else { } else {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message); showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
} }
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment