Skip to content

Conversation

@kmichalikk
Copy link
Contributor

@kmichalikk kmichalikk commented Mar 21, 2025

Closes #1785

This PR refactors tokenVerification function in AuthService:

  • extracts functions for user changin and parsing error messages coming from server
  • adds null coalescence operator when using keycloak object to match type definitions

…ging and preparing customized error messages based on server response, add missing null coalescence operator for calls on keycloak object
@grzanka
Copy link
Contributor

grzanka commented Mar 24, 2025

I've switched on frontend and backend, selected some example and ran a simulation.
Then I saw the results in Z_profile tab.

Then I decided to disable backend.

Then I clicked on YZ_profile and saw two things:

In that case I was expecting a good error message that backend is unreachable and app cannot display results.

Do you think this case can be handled in this PR or deserves another issue ?

image
image

Only after some time I got this:

image

The text "Keycloak User Rejected" is meaningless to the user, he doesn't know what is a keycloak.
It would be better to provide an URL of the unreachable backend.

@kmichalikk
Copy link
Contributor Author

kmichalikk commented Mar 24, 2025

Do you think this case can be handled in this PR or deserves another issue ?

I think this case should be fixed separately because it comes from different component and different logic. Ideally, there should be some kind of global "middleware" that catches when backend is disconnected and shows the dialog, logs the user out, etc. Without that, we will be patching every component that fetches something from backend separately, which is redundant and inconsistent.

@grzanka
Copy link
Contributor

grzanka commented Mar 25, 2025

Do you think this case can be handled in this PR or deserves another issue ?

I think this case should be fixed separately because it comes from different component and different logic. Ideally, there should be some kind of global "middleware" that catches when backend is disconnected and shows the dialog, logs the user out, etc. Without that, we will be patching every component that fetches something from backend separately, which is redundant and inconsistent.

Good idea ! Can you submit such an new issue ?

@kmichalikk
Copy link
Contributor Author

#1988

@grzanka grzanka added this pull request to the merge queue Mar 25, 2025
Merged via the queue into master with commit d8e2ee5 Mar 25, 2025
9 checks passed
@grzanka grzanka deleted the login-error-messages-1785 branch March 25, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Present meaningful message to user when backend is unreachable

3 participants