Skip to content
This repository was archived by the owner on Aug 11, 2025. It is now read-only.
This repository was archived by the owner on Aug 11, 2025. It is now read-only.

Users should be informed the reason they have been logged out when token expires #751

@patriciareinoso

Description

@patriciareinoso

Current situation

Whenever the authorization token expires, the user is automatically logged out and the login page is shown to the user. However, the user is not informed of what happened.

The desired behavior

Whenever the token expire, the user should be logged out and should be informed with a meaningful message that the session expired.

To Reproduce

We do not need to wait for the token to expire to reproduce this behavior:

  1. Deploy the local development NMS -> make deploy
  2. Register a user, create resources
  3. make hotswap (which makes the token invalid)
  4. You'll be logged out and see the log in page.

The current state of the code

This is the code that identifies invalid tokens and logs out the user. The changes should be applied everywhere in the code.

    if (is401UnauthorizedError(query.error)) {
      auth.logout();
    }

The difficult part of this task is how to decide whether to show or not the message in the login page according to the situation :

  1. it's the first time we are logging in
  2. we explicitly clicked in log out button
  3. token expired

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions