Get token without popup

I have a react app that uses @auth0/auth0-spa-js. If getTokenSilently() fails, I fall back to getTokenWithPopup() in order to allow the user to “grant” access to certain claims.

But the popup seems a bit flimsy on mobile devices. Is there a full page redirect that I can use? (similar to how loginWithRedirect() works)

Hi @truescope,

After looking at the docs I found some display options that might help with this:

https://auth0.github.io/auth0-spa-js/interfaces/gettokenwithpopupoptions.html

I haven’t tried it, so I cannot confirm. But it may be worth investigating.

Just to confirm about your setup, are you accessing the SPA on a mobile browser like Chrome or Safari?

Let me know.

Thanks,
Dan

Hi Dan
Yes, I’ve tested it using safari and chrome on an iphone, ipad and android mobile device. I might see if i can leverage that ‘display’ option and set it to “touch” or “page”. Thanks mate

1 Like

Let us know how this goes, it sounds like it could be useful for other community members.

Thanks,
Dan

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.