React Native redirect fails

I have resolved this issue

Hi Michael,

Thanks for sharing the details! It looks like you’re experiencing an issue with the redirect URL in your React Native app using the Web3Auth PnP Web SDK and Expo router. Let’s summarize the details:

  • SDK Details: PnP Web SDK
  • Platform: React Native with Expo Router
  • Issue: Extra slash / added in the redirect URL after Google login.
  • Scheme: 'dire'

You’ve shared the initialization code and your logic for setting up the redirectUrl. Your approach seems correct by distinguishing between standalone and development environments. However, the extra slash might be due to how the URL is being constructed or recognized by the framework.

Suggestion:

  1. Check the Scheme Configuration: Ensure that the scheme 'dire' is correctly configured in your app’s app.json or app.config.js.
  2. URL Handling Logic: Try logging the redirectUrl just before passing it to Web3Auth to ensure it’s being set correctly.
  3. Slash Handling: Double-check any URL handling or middleware in your Expo app that might be altering the path.

If none of these help, please provide any custom URL handling or middleware logic you might have.

Let me know if these suggestions help or if there’s anything else you’d like to explore!

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours