magic-js
magic-js copied to clipboard
URL Reset and Authentication Failure: Reloading Page as Unauthenticated User Results in URL Clearing and 400 Error
✅ Prerequisites
- [x] Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
- [x] Are you running the latest SDK version?
- [x] Are you reporting to the correct repository (
magic-sdk)?
🐛 Description
Upon attempting to reload the page with the URL baseURL/?category=nfts while not authenticated, an unexpected issue arises. Instead of maintaining the current URL, the page's URL inexplicably reverts back to the base baseURL. This anomaly is further exacerbated by the receipt of a 400 error from the https://auth.magic.link/v1/session/refresh URL, a component associated with user authentication.
🧩 Steps to Reproduce
-
Visit https://codesandbox.io/p/github/Adebesin-Cell/Magic-Connector-Bug/main
-
Click on the "Hi, Click Me" button.
-
The page should change the URL to
baseURL/?category=nfts -
The button also triggers a reload, after a while the URL clears and shows the log about refresh failing.
-
Once the request fails, the whole URL resets
🤔 Expected behavior
baseURL/?category=nfts is meant to be the URL, not a reset URL. Expected behavior can be gotten by logging in with meta mask wallet and the page URL doesn't clear.
😮 Actual behavior
An uncalled request clears the URL to the base URL.
Stack Trace
💻 Code Sample
Here's the code repo to test the issue. https://github.com/Adebesin-Cell/Magic-Connector-Bug
🌎 Environment
| Software | Version(s) |
|---|---|
@magiclabs/wagmi-connector |
^1.1.0 |
| Browser | Chrome |
yarn |
v1.22.19 |
| Operating System | MacOS |
Hi, is there any update with this issue?