Skip to content

Out of sync server and client state / Client uses invalid session #489

Closed
@xxRockOnxx

Description

@xxRockOnxx

Version

@nuxtjs/supabase: 1.5.0
nuxt: 3.16.1

Reproduction Link

To follow if requested.

Steps to reproduce

  • install module
  • sign up
  • sign in
  • invalidate by deleting user on supabase dashboard
  • not working

What is Expected?

Client will not have user value because the session/token is now invalid.

What is actually happening?

Client has user value.

The server plugin both use from the sdk:

  • getSession() for useSupabaseSession() (can be seen here)
  • getUser() for useSupabaseUser() (can be seen here)

The client plugin both uses getSession() for:

  • useSupabaseSession()
  • useSupabaseUser()

(can be seen here)

which according to the Supabase docs is not recommended.

Image

Regardless of the Supabase recommendation, it's still not the populated the same way as server state.


I might even add not to populate it manually on client side and just handle the updates.

useState() should already share state from server to client.

the server plugin already had it done correctly.

the client plugin should just handle the future updates.

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