Skip to content

[BUG]: trying to signOut of an invalid session should still clear local storage #1075

@Snehil-Shah

Description

@Snehil-Shah

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

Trying to sign out of an invalid/non-existent session throws a [AuthSessionMissingError: Auth session missing!] error and doesn't clear the invalid session from local storage, causing the client to hang.

To Reproduce

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

  1. Login to the same account from two devices.
  2. Sign out from one device with global scope (removes all sessions)
  3. Try to sign out from the second device.
  4. See error.

Expected behavior

The error is correct as the session doesn't exist anymore, but it should clear the invalid session from local storage instead of returning early with an error.

System information

  • OS: Windows
  • Client: Expo apps
  • Version of supabase-js: 2.5.0
  • Version of Node.js: 22.13.1

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