mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-03 11:40:44 +03:00
Working on bugs
This commit is contained in:
parent
b6114e7d2c
commit
058386fa88
@ -137,7 +137,6 @@ export const setUserDataWithPinCode = async (data) => {
|
||||
const userData = result[0];
|
||||
|
||||
const privateKeys = getPrivateKeys(userData.username, data.password);
|
||||
|
||||
const updatedUserData = {
|
||||
username: userData.username,
|
||||
authType: userData.authType,
|
||||
@ -193,11 +192,9 @@ export const updatePinCode = async (data) => {
|
||||
};
|
||||
|
||||
export const verifyPinCode = async (data) => {
|
||||
const pinHash = getPinCode();
|
||||
const pinHash = await getPinCode();
|
||||
|
||||
// CHECK PIN HASH with console log
|
||||
|
||||
if (sha256(data.pinCode) !== pinHash) {
|
||||
if (sha256(data.pinCode).toString() !== pinHash) {
|
||||
return Promise.reject(new Error('Invalid pin code, please check and try again'));
|
||||
}
|
||||
|
||||
|
@ -298,7 +298,7 @@ export const setPinCode = pinCode => new Promise((resolve, reject) => {
|
||||
const pinHash = sha256(pinCode);
|
||||
|
||||
realm.write(() => {
|
||||
auth[0].pinCode = pinHash;
|
||||
auth[0].pinCode = pinHash.toString();
|
||||
resolve(auth[0]);
|
||||
});
|
||||
} catch (error) {
|
||||
|
@ -161,7 +161,6 @@ class PinCodeContainer extends Component {
|
||||
accessToken,
|
||||
navigateTo,
|
||||
navigation,
|
||||
setWrappedComponentState,
|
||||
} = this.props;
|
||||
|
||||
// If the user is exist, we are just checking to pin and navigating to home screen
|
||||
@ -172,10 +171,8 @@ class PinCodeContainer extends Component {
|
||||
accessToken,
|
||||
};
|
||||
verifyPinCode(pinData)
|
||||
.then((res) => {
|
||||
setWrappedComponentState(res);
|
||||
.then(() => {
|
||||
this._savePinCode(pin);
|
||||
|
||||
const realmData = getUserDataWithUsername(currentAccount.name);
|
||||
const _currentAccount = currentAccount;
|
||||
_currentAccount.username = _currentAccount.name;
|
||||
|
Loading…
Reference in New Issue
Block a user