Skip to content

Breaking change, session null onAuthStateChange #1335

@cmcnicholas

Description

@cmcnicholas

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

After upgrading to latest library version 2.47.6 from 2.47.5 I am being logged out of my application due to a null session.

To Reproduce

We use the following to map auth session values to a reactive value. I've never before experienced null sessions when logged in.

    // listen to auth state changes
    client.auth.onAuthStateChange((event, session) => {
      if (session === null) {
        window.location.href = createRedirectUrl('unauthenticated_state', window.location.href);
      } else {
        authSession.value = session;
      }
    });

Expected behavior

null session shouldn't be reported as the session is valid (prior call to GetSession() confirms this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions