Skip to content

Context user is not being refresh when silentLogin() suceed #55

@pablovillacanas

Description

@pablovillacanas

The user on the UserData context that is used to determine whether the session has expired is not being updated since the didComponentMount() function of Authenticator.
That means, at least in my case, that when I silentLogin() with the userManager, it stores internally the new reference of the user, but the context and therefore, the Authenticator state, is not being updated. It leads to a malfunction when I refresh the page and the Authenticator reevaluated if user.isValid() as it is taking the Authenticator internal user state and not the userManager user one.

I have bypassed this behavior with some embarrassing bunch of things (one of them is hardcoded the userData.user value.

FYI:

  • The app is a SPA. makeAuthenticator util function is located as in the README.md.
  • The WrappedComponent is a FunctionalComponent that renders three p[possible pages depending on the user state.
  • We are using the same callback for renew and login without refresh token (not provided by backend)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions