removed saving pin code codes

This commit is contained in:
Mustafa Buyukcelebi 2018-12-21 17:55:30 +03:00
parent fabaf93fb7
commit b9ad7c07f2

View File

@ -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 = {