Commit aa69d1d2 by Giang Tran

fix bug chang password

parent 3b82aa35
......@@ -16,7 +16,12 @@ import {
useBlurOnFulfill,
useClearByFocusCell,
} 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 {NEWPASSWORD} from '../../routers/ScreenNames';
import {verifyOTPApi} from '../../apis/Functions/users';
......@@ -70,7 +75,7 @@ const ConfirmOTP = (propsa) => {
const res = await verifyOTPApi({
platform: Platform.OS,
receiver_name: propsa.route.params.email,
otp: value,
otp: encryptRSAString(value),
type: 'FORGOT_PASSWORD',
});
......
......@@ -12,7 +12,12 @@ import HeaderBack from '../../components/Header/HeaderBack';
import {forgotPasswordApi} from '../../apis/Functions/users';
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 {AUTHEN} from '../../routers/ScreenNames';
import I18n from '../../helper/i18/i18n';
......@@ -20,7 +25,6 @@ import I18n from '../../helper/i18/i18n';
import {showLoading, hideLoading} from '../../actions/loadingAction';
import {connect} from 'react-redux';
import {showAlert, TYPE} from '../../components/DropdownAlert';
import {encryptRSAString} from '../../Config/Functions';
const NewPassword = (props) => {
const [password, setPassword] = useState('');
......@@ -36,7 +40,7 @@ const NewPassword = (props) => {
props.showLoading();
const res = await forgotPasswordApi({
receiver_name: email,
otp,
otp: encryptRSAString(otp),
password: encryptRSAString(password),
password_confirmation: encryptRSAString(cfPassword),
platform: Platform.OS,
......@@ -54,7 +58,7 @@ const NewPassword = (props) => {
I18n.t('ChangePasswordSuccess'),
);
} 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