Skip to content

auth.onAuthStateChanged triggers on tab switch #442

@noty-nick

Description

@noty-nick

Bug report

Describe the bug

auth.onAuthStateChanged triggers on tab switch

To Reproduce

  1. Create starter project using this guide https://supabase.com/docs/guides/with-vue-3

  2. add lines to src/main.js

import { supabase } from "./supabase";
supabase.auth.onAuthStateChange(console.log);
  1. run npm run dev
  2. open http://localhost:3000 in browser
  3. open dev console
  4. Switch to another tab
  5. Switch back to previous tab

Expected behavior

1 SIGNED_IN event in console

Actuall behaviour

2 SIGNED_IN event in console

Screenshots

https://www.loom.com/share/56993404e5f348d2bb23b68b0ad15096

System information

  • OS: macOS
  • Browser (if applies) brave
  • Version of supabase-js: 1.35.3
  • Version of Node.js: 16.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions