User getting logged out from my app as soon he's redirected to a page

Hello everyone, I’m trying to integrate my DApp with USDC Access , a feature offered by Circle .

For authentication I’m using web3auth ( users can login to my app using their email or phone numbers only ).
I want to have USDC on ramp support in my app and therefore I’m integrating USDC Access.

I’m facing one problem in integrating it. According to USDC access’s documentation when calling the USDC create session api, we can provide a redirect url , when the session gets completed the user gets redirected to this page.

As I’m in development mode currently, I set the redirectUrl to ‘http://localhost:5173/smart-wallet

I can see that indeed when the USDC session completes, the user is redirected to this http://localhost:5173/smart-wallet url with the full URL being something like

http://localhost:5173/smart-wallet/sessionId?=session-id-in-uuid-format

but as soon as the user is redirected to this page, the user gets immediately logged out . What may be the reason for this issue? Am I doing something wrong ?

I tested the redirectedUrl part by deploying to Netlify as well . User keeps getting logged out , why ?

  • SDK Version(package.json):
    @web3auth/base”: “^9.3.0”,
    @web3auth/default-evm-adapter”: “^9.3.0”,
    @web3auth/ethereum-provider”: “^9.3.0”,
    @web3auth/modal”: “^9.3.0”,

  • Platform: Web ( ReactJS )