NASA-PDS / doi-ui

The web interface for the PDS DOI Service providing the ability management PDS archive DOIs. See the DOI Service for more details on the available capabilities. https://nasa-pds.github.io/doi-service/
Apache License 2.0
0 stars 4 forks source link

When the cognito token is expired, the UI fails and returns a misleading/badly formatted error message #215

Closed tloubrieu-jpl closed 7 months ago

tloubrieu-jpl commented 7 months ago

Checked for duplicates

No - I haven't checked

πŸ› Describe the bug

When I

  1. authenticate on the doi-ui,
  2. make one successful operation (reserve a DOI)
  3. wait for a couple of minute
  4. make a second operation (create a published DOI, from its url)
  5. I am getting the error message here:
image

πŸ•΅οΈ Expected behavior

I expected:

  1. the error message to be properly formatted, using directly the address to pds_operator since lately the feedback widget was not working too well.
  2. Not to have this message, since I am still authenticated in the UI (my login shows on the top-right, I have not been warned about my session being invalid).
  3. the request being successful by having the token of the request to the API being renewed.

Maybe the token to connect to the API is not requested when it should ? Are we trying to use the same API token for the full UI session ?

πŸ“œ To Reproduce

See scenario above. Can be reproduced on a local deployment of the UI and the API using the latest dev versions.

πŸ–₯ Environment Info

No response

πŸ“š Version of Software Used

DOI-UI: 0.3.0-beta.1 DOI-SERVICE: 2.4.0

🩺 Test Data / Additional context

No response

πŸ¦„ Related requirements

πŸ¦„ #xyz

βš™οΈ Engineering Details

No response

tloubrieu-jpl commented 7 months ago

@ramesh-maddegoda helped me to solve the issue, the property jwt_lifetime_seconds in configuration of the doi-service did not match the expiration udration of the token for the doi-ui application.

Some details on that will be added to the configuration file comments so that the mistake is not done again. `

tloubrieu-jpl commented 7 months ago

This is fixed by adding a comment in the default configuration to avoid such mistake in the future https://github.com/NASA-PDS/doi-service/commit/61fa4aa93593dc37921c708e1cff13a276ef2eaa