Fixed the undefined private key issue

This commit is contained in:
Vladyslav Matsiiako
2022-12-09 12:45:47 -05:00
parent 3d25baa319
commit 8266c4dd6d

View File

@@ -3,7 +3,7 @@ interface Props {
encryptedPrivateKey: string;
iv: string;
tag: string;
privateTag: string;
privateKey: string;
}
export const saveTokenToLocalStorage = ({
@@ -11,14 +11,14 @@ export const saveTokenToLocalStorage = ({
encryptedPrivateKey,
iv,
tag,
privateTag,
privateKey,
}: Props) => {
try {
localStorage.setItem("publicKey", publicKey);
localStorage.setItem("encryptedPrivateKey", encryptedPrivateKey);
localStorage.setItem("iv", iv);
localStorage.setItem("tag", tag);
localStorage.setItem("PRIVATE_KEY", privateTag);
localStorage.setItem("PRIVATE_KEY", privateKey);
} catch (err) {
if (err instanceof Error) {
throw new Error(