Skip to content

Commit

Permalink
🐛 Use lcoalstorage
Browse files Browse the repository at this point in the history
  • Loading branch information
mhetreayush committed Jun 7, 2024
1 parent 96bddbf commit 01a1a26
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions js/ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ function App() {
console.log("Inside useeffect", { signature });
if (typeof signature === "string") {
setLocalSignature(signature);
localStorage.setItem("siweSignature", signature);
}
}, [signature]);
React.useEffect(() => {
Expand Down Expand Up @@ -189,15 +190,23 @@ function App() {
const session = {
message,
raw: signMessage,
signature: localSignature,
signature: localStorage.getItem("siweSignature") ?? localSignature,
};
onVerifyAddressSuccess();

setTimeout(() => {
console.log("Inside timeout", { localSignature, session });
Cookies.set("siwe", JSON.stringify(session), {
expires: expirationTime,
});
Cookies.set(
"siwe",
JSON.stringify({
...session,
signature: localStorage.getItem("siweSignature") ?? localSignature,
}),
{
expires: expirationTime,
}
);
localStorage;

window.location.replace(
`/sign_in?redirect_uri=${encodeURI(redirect)}&state=${encodeURI(
Expand Down

0 comments on commit 01a1a26

Please sign in to comment.