only put if hasSetKeys explicitly false

This commit is contained in:
Abhinav-grd 2021-08-30 23:22:56 +05:30
parent a7a10f1a19
commit c21b20df95

View file

@ -140,9 +140,10 @@ export const isTokenValid = async () => {
'X-Auth-Token': getToken(), 'X-Auth-Token': getToken(),
} }
); );
if (!resp?.data?.hasSetKeys) {
try { try {
putAttributes( if (!resp.data['hasSetKeys']) {
try {
await putAttributes(
getToken(), getToken(),
getData(LS_KEYS.ORIGINAL_KEY_ATTRIBUTES) getData(LS_KEYS.ORIGINAL_KEY_ATTRIBUTES)
); );
@ -150,6 +151,9 @@ export const isTokenValid = async () => {
logError(e, 'put attribute failed'); logError(e, 'put attribute failed');
} }
} }
} catch (e) {
logError(e, 'hasSetKeys not set in session validity response');
}
return true; return true;
} catch (e) { } catch (e) {
return false; return false;