Skip to content

useSession/Provider does not update when a new session is created until page reload. #2208

@paul-vd

Description

@paul-vd

Description 🐜

When a page is not reloaded after login, the useSession/Provider is never updated, even after calling getSession.

How to reproduce ☕️

  1. Here is a reproduction of the issue.
  2. I have set up a modal based login using a security code, for this example, I have hardcoded the security code to TEST
  3. When you log in successfully, the callpack API triggers an additional getSession.
  4. At this stage the cookies are created and the session should be there, but the provider does not update until you refresh the page.

Screenshots / Logs 📽

example

Environment 🖥

  System:
    OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 11.23 GB / 24.97 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 14.16.1 - ~/.nvm/versions/node/v14.16.1/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v14.16.1/bin/yarn
    npm: 6.14.12 - ~/.nvm/versions/node/v14.16.1/bin/npm

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