Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] On browser refresh my Sign popup is coming even though siwx session from localstorage is cleared [from logout button] by using await SIWXUtil.clearSessions(); #3778

Open
narutodev123 opened this issue Feb 2, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@narutodev123
Copy link

Link to minimal reproducible example

await SIWXUtil.clearSessions();

Summary

[bug] On browser refresh my Sign popup is coming even though siwx session from localstorage is cleared [from logout button] by using await SIWXUtil.clearSessions();

Clearning the session using this function
async function cleanSession() { await SIWXUtil.clearSessions(); }

bug_report.mp4

List of related npm package versions

"dependencies": {
"@reown/appkit": "^1.6.5",
"@reown/appkit-adapter-wagmi": "^1.6.5",
"@reown/appkit-siwx": "^1.6.5",
"@tanstack/react-query": "^5.65.0",
"nanoid": "^5.0.9",
"next": "14.2.18",
"next-auth": "^4.24.11",
"react": "^18",
"react-dom": "^18",
"viem": "^2.22.15",
"wagmi": "^2.14.9"
},

Node.js Version

20.11.0

Package Manager

10.2.4

@narutodev123 narutodev123 added bug Something isn't working needs review labels Feb 2, 2025
@narutodev123
Copy link
Author

cc @rtomas

@rtomas
Copy link
Contributor

rtomas commented Feb 6, 2025

Ok. I will be talking to the engineer team and try to get back with a solution.

@narutodev123
Copy link
Author

Thank you @rtomas.

@zoruka
Copy link
Contributor

zoruka commented Feb 7, 2025

Hey @narutodev123!

Do you mind sharing the use case where you want to clean the session without disconnecting?
This behavior of popping up to sign message when you refresh the page is expected to happen because you are still connected, but without a valid session. Furthermore SIWXUtil is actually an object designed to be used internally of AppKit.

@narutodev123
Copy link
Author

narutodev123 commented Feb 8, 2025

Hey @zoruka,
Thank for your reply, I have logout button in my application when user click on logout i just want to clear the siwx session don't want to disconnect the wallet and once he click on signin button then just need to sign the signature and login into the system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants