Skip to content

Unable to logout user on react-native due to AuthSessionMissingErrorย #1543

@ishchhabra

Description

@ishchhabra

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

The quickstart guide for Supabase Auth for react-native uses getSession (as opposed to getUser).

If we have a user logged in at two locations A (next.js app) and B (react-native app), when the user logs out from location A with global scope and then tries to log out from location B, the logout returns an AuthSessionMissingError error, and the user is unable to log out ever since the sign out keeps failing but the session indicates a user existing.

If we switch the A and B in this scenario, it will work fine because next.js app recommends using getUser instead. It also works fine on using getUser in the mobile application as well. I've not yet tested with getClaims yet but I'd guess since that is a local check, it might result in similar problem.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Follow the official supabase documentation for next.js app (A) and react-native app (B)
  2. Login on A
  3. Login on B
  4. Sign out from A with global scope
  5. Sign out from B. The application will get stuck

Expected behavior

I think when an AuthSessionMissingError is received from the server, the library should probably just sign out the user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions