Logout with Expo

Hi there,

I’m facing similar problems to the following unresolved issues:


I’m able to log in to auth0 using the example here: https://github.com/expo/examples/tree/master/with-auth0

I’m using the following to try to log the user out
await WebBrowser.openBrowserAsync(
${myAuth0Domain}/v2/logout?client_id=${auth0ClientId}&returnTo=${redirectUrl},
)

When I do so and check the logs in the auth0 console, I see a successful logout. However, when I hit the /authorize endpoint again, I’m still logged in.

I’ve seen https://auth0.com/docs/logout?_ga=2.217295190.1929569498.1606749138-1023768938.1603381447, but it’s not clear from those docs how I can clear the appropriate cookies since I can’t use the react-native SDK with expo.

Any help would be appreciated.

Thanks,
Noah

Noah, have you been able to solve this? I’m seeing the same behavior and am also a bit puzzled. But maybe it’s something we need to take up with the Expo folks?

Thanks

Hannes

Hi @hannes.hesse ,

This has shifted down my list of priorities lately, and I haven’t figured out a solution yet. I was doing some digging during the holiday break, and I think the solution lies somewhere in the expo AuthSession docs. Specifically, my next shot would be to mess around with some of the methods exposed there, specifically AuthSession.revokeAsync(). I still haven’t attempted this solution, but I think the issue has to do with cookies being passed back from the expo WebBrowser that AuthSession is built on top of.

So, using WebBrowser.openAuthSessionAsync instead of openBrowserAsync works for me – though I’m not clear why.