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,15 +140,19 @@ export const isTokenValid = async () => {
'X-Auth-Token': getToken(),
}
);
if (!resp?.data?.hasSetKeys) {
try {
putAttributes(
getToken(),
getData(LS_KEYS.ORIGINAL_KEY_ATTRIBUTES)
);
} catch (e) {
logError(e, 'put attribute failed');
try {
if (!resp.data['hasSetKeys']) {
try {
await putAttributes(
getToken(),
getData(LS_KEYS.ORIGINAL_KEY_ATTRIBUTES)
);
} catch (e) {
logError(e, 'put attribute failed');
}
}
} catch (e) {
logError(e, 'hasSetKeys not set in session validity response');
}
return true;
} catch (e) {