Skip to content

After logging in, the user details are not updated until you refresh #1107

@kriswest

Description

@kriswest

Describe the bug
On logging into git proxy (as an admin), the user's admin rights do not apply immediately. For example if you login while viewing the repositories list, the add repository button will not be visible. The issues clears up after a refresh or navigation, as the user context gets populated correctly then.

I'm fairly sure the issue is down to the imported refreshUser fn, I think its being run out of context and is failing to update the AuthProvider. On refresh of the page or navigation via a link it get populated correctly, resolving the problem. However, until you do so the user object in the context is not populated (same as for logged out users).

To Reproduce
Steps to reproduce the behavior:

  1. Ensure you are logged out
  2. Visit the repositories page and observe the lack of an 'add repository' button
  3. Login (as an admin user)
  4. Observe that the 'add repository' button is still missing
  5. Refresh the page and observe that the 'add repository' button appears.

Expected behavior
After login, the user's profile data is available.

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