Skip to content

Commit

Permalink
added check in decrypt function
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavanakarwade committed Dec 5, 2024
1 parent 8a3c009 commit 10038f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,10 @@ export const getFromLocalStorage = async (key: string) => {
return null;
}

const decryptedValue = decryptData(encryptedValue);
const decryptedValue = encryptedValue ? decryptData(encryptedValue) : '';
console.log(`Decrypted value for [${key}]:`, decryptedValue);

return decryptedValue ? JSON.parse(decryptedValue) : null;
return decryptedValue;
} catch (error) {
console.error(`Error getting localStorage [${key}]:`, error);
return null;
Expand Down

0 comments on commit 10038f6

Please sign in to comment.