Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle separately 401 and 403 api errors in UI #1740

Merged

Conversation

frascuchon
Copy link
Member

@frascuchon frascuchon commented Sep 30, 2022

Since the changes included in #1713, users without permission trying to delete datasets from UI will hit into a re-login operation.

This PR handles separate authentication errors (401) and forbidden errors (403).

We should find a better way to handle error codes and info in general.

Refs: #1713

frontend/plugins/vuex-orm-axios.js Outdated Show resolved Hide resolved
frontend/plugins/vuex-orm-axios.js Outdated Show resolved Hide resolved
type: "warning",
});
break;
default:
Notification.dispatch("notify", {
message: error,
message: "Error: " + messageDetail.params.detail,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some code smeller recommends to concatenate strings with backtick like so : (backtick)Error: ${messageDetail.params.detail}(backtick)

frontend/plugins/vuex-orm-axios.js Outdated Show resolved Hide resolved
frontend/plugins/vuex-orm-axios.js Outdated Show resolved Hide resolved
@frascuchon frascuchon merged commit bcce856 into releases/0.x Sep 30, 2022
@frascuchon frascuchon deleted the bugfixes/handle-ui-error-when-cannot-delete-dataset branch September 30, 2022 13:35
frascuchon added a commit that referenced this pull request Sep 30, 2022
Since the changes included in #1713, users without permission trying to delete datasets from UI will hit into a re-login operation.

This PR handles separate authentication errors (401) and forbidden errors (403).

We should find a better way to handle error codes and info in general.

Refs: #1713
frascuchon added a commit that referenced this pull request Sep 30, 2022
…users (#1713)

* feat(Datasets): restrict dataset deletion only to creators and super-users

* tests: add tests for datasets deletion check

* chore: improve deletion error message

Co-authored-by: Daniel Vila Suero <daniel@recogn.ai>

* Format long strings

Co-authored-by: Daniel Vila Suero <daniel@recogn.ai>

(cherry picked from commit c5ab270)
fix: handle separately 401 and 403 api errors in UI (#1740)

Since the changes included in #1713, users without permission trying to delete datasets from UI will hit into a re-login operation.

This PR handles separate authentication errors (401) and forbidden errors (403).

We should find a better way to handle error codes and info in general.
frascuchon added a commit that referenced this pull request Oct 3, 2022
…users (#1713)

* feat(Datasets): restrict dataset deletion only to creators and super-users

* tests: add tests for datasets deletion check

* chore: improve deletion error message

Co-authored-by: Daniel Vila Suero <daniel@recogn.ai>

* Format long strings

Co-authored-by: Daniel Vila Suero <daniel@recogn.ai>

(cherry picked from commit c5ab270)
fix: handle separately 401 and 403 api errors in UI (#1740)

Since the changes included in #1713, users without permission trying to delete datasets from UI will hit into a re-login operation.

This PR handles separate authentication errors (401) and forbidden errors (403).

We should find a better way to handle error codes and info in general.
frascuchon added a commit that referenced this pull request Oct 4, 2022
…users (#1713)

* feat(Datasets): restrict dataset deletion only to creators and super-users

* tests: add tests for datasets deletion check

* chore: improve deletion error message

Co-authored-by: Daniel Vila Suero <daniel@recogn.ai>

* Format long strings

Co-authored-by: Daniel Vila Suero <daniel@recogn.ai>

(cherry picked from commit c5ab270)
fix: handle separately 401 and 403 api errors in UI (#1740)

Since the changes included in #1713, users without permission trying to delete datasets from UI will hit into a re-login operation.

This PR handles separate authentication errors (401) and forbidden errors (403).

We should find a better way to handle error codes and info in general.
frascuchon added a commit that referenced this pull request Oct 5, 2022
…users (#1713)

* feat(Datasets): restrict dataset deletion only to creators and super-users

* tests: add tests for datasets deletion check

* chore: improve deletion error message

Co-authored-by: Daniel Vila Suero <daniel@recogn.ai>

* Format long strings

Co-authored-by: Daniel Vila Suero <daniel@recogn.ai>

(cherry picked from commit c5ab270)
fix: handle separately 401 and 403 api errors in UI (#1740)

Since the changes included in #1713, users without permission trying to delete datasets from UI will hit into a re-login operation.

This PR handles separate authentication errors (401) and forbidden errors (403).

We should find a better way to handle error codes and info in general.
frascuchon added a commit that referenced this pull request Oct 5, 2022
…users (#1713)

* feat(Datasets): restrict dataset deletion only to creators and super-users

* tests: add tests for datasets deletion check

* chore: improve deletion error message

Co-authored-by: Daniel Vila Suero <daniel@recogn.ai>

* Format long strings

Co-authored-by: Daniel Vila Suero <daniel@recogn.ai>

(cherry picked from commit c5ab270)
fix: handle separately 401 and 403 api errors in UI (#1740)

Since the changes included in #1713, users without permission trying to delete datasets from UI will hit into a re-login operation.

This PR handles separate authentication errors (401) and forbidden errors (403).

We should find a better way to handle error codes and info in general.
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.

None yet

2 participants