mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-26 14:54:19 +03:00
removed saving pin code codes
This commit is contained in:
parent
fabaf93fb7
commit
b9ad7c07f2
@ -5,8 +5,6 @@ import {
|
|||||||
setAuthStatus,
|
setAuthStatus,
|
||||||
getUserDataWithUsername,
|
getUserDataWithUsername,
|
||||||
updateUserData,
|
updateUserData,
|
||||||
setPinCode,
|
|
||||||
getPinCode,
|
|
||||||
updateCurrentUsername,
|
updateCurrentUsername,
|
||||||
getUserData,
|
getUserData,
|
||||||
} from '../../realm/realm';
|
} from '../../realm/realm';
|
||||||
@ -145,8 +143,6 @@ export const setUserDataWithPinCode = async (data) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
await setAuthStatus(authData);
|
await setAuthStatus(authData);
|
||||||
const encriptedPinCode = encryptKey(data.pinCode, 'pin-code');
|
|
||||||
await setPinCode(encriptedPinCode);
|
|
||||||
return (response);
|
return (response);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -173,8 +169,6 @@ export const updatePinCode = async (data) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
await setAuthStatus(authData);
|
await setAuthStatus(authData);
|
||||||
const encriptedPinCode = encryptKey(data.pinCode, 'pin-code');
|
|
||||||
await setPinCode(encriptedPinCode);
|
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
});
|
});
|
||||||
@ -187,7 +181,6 @@ export const verifyPinCode = async (data) => {
|
|||||||
let account = null;
|
let account = null;
|
||||||
let loginFlag = false;
|
let loginFlag = false;
|
||||||
if (result.length > 0) {
|
if (result.length > 0) {
|
||||||
if (userData.masterKey || userData.accessToken) {
|
|
||||||
if (userData.authType === 'steemConnect') {
|
if (userData.authType === 'steemConnect') {
|
||||||
const accessToken = decryptKey(userData.accessToken, data.pinCode);
|
const accessToken = decryptKey(userData.accessToken, data.pinCode);
|
||||||
await steemConnect.setAccessToken(accessToken);
|
await steemConnect.setAccessToken(accessToken);
|
||||||
@ -216,16 +209,6 @@ export const verifyPinCode = async (data) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
const encriptedPinCode = await getPinCode();
|
|
||||||
const pinCode = decryptKey(encriptedPinCode, 'pin-code');
|
|
||||||
if (pinCode === data.pinCode) {
|
|
||||||
const res = await setUserDataWithPinCode(data);
|
|
||||||
if (res) {
|
|
||||||
loginFlag = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (loginFlag) {
|
if (loginFlag) {
|
||||||
const authData = {
|
const authData = {
|
||||||
|
Loading…
Reference in New Issue
Block a user