magic-js icon indicating copy to clipboard operation
magic-js copied to clipboard

URL Reset and Authentication Failure: Reloading Page as Unauthenticated User Results in URL Clearing and 400 Error

Open Adebesin-Cell opened this issue 2 years ago • 1 comments

✅ 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

  1. Visit https://codesandbox.io/p/github/Adebesin-Cell/Magic-Connector-Bug/main

  2. Click on the "Hi, Click Me" button.

  3. The page should change the URL to baseURL/?category=nfts

  4. The button also triggers a reload, after a while the URL clears and shows the log about refresh failing. Screen Shot 2023-08-23 at 11 21 03 AM

  5. 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

Screen Shot 2023-08-23 at 11 21 03 AM

💻 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

Adebesin-Cell avatar Aug 23 '23 10:08 Adebesin-Cell

Hi, is there any update with this issue?

Adebesin-Cell avatar Jun 25 '24 19:06 Adebesin-Cell