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: JSON parsing error is shown when deleting account #55

Merged
merged 4 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [3.1.3] - 2024-04-18
### Fixed
- JSON parsing error is shown when deleting account

### Security
- chore(deps): bump webpack-dev-middleware from 5.3.3 to 5.3.4 by @dependabot in #53
- chore(deps): bump express from 4.18.2 to 4.19.2 by @dependabot in #54

## [3.1.2] - 2024-03-20
### Security
- chore(deps): bump @babel/traverse from 7.22.8 to 7.23.2 by @dependabot in #46
- chore(deps-dev): bump postcss from 8.4.19 to 8.4.31 by @dependabot in #45
- chore(deps): bump follow-redirects from 1.15.2 to 1.15.6 by @dependabot in #51

### Internal
- Added Dockerfile

## [3.1.1] - 2023-09-12

### Fixed
Expand Down Expand Up @@ -48,7 +65,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Merge pull request #9 from privacybydesign/firefox-fix
- Fix: remove invalid fallback URL to solve issues on Firefox for Android

[3.1.1]: https://github.com/privacybydesign/irma_keyshare_webclient/compare/v3.0.0...v3.1.1
[3.1.3]: https://github.com/privacybydesign/irma_keyshare_webclient/compare/v3.1.2...v3.1.3
[3.1.2]: https://github.com/privacybydesign/irma_keyshare_webclient/compare/v3.1.1...v3.1.2
[3.1.1]: https://github.com/privacybydesign/irma_keyshare_webclient/compare/v3.1.0...v3.1.1
[3.1.0]: https://github.com/privacybydesign/irma_keyshare_webclient/compare/v3.0.0...v3.1.0
[3.0.0]: https://github.com/privacybydesign/irma_keyshare_webclient/compare/v2.0.3...v3.0.0
[2.0.3]: https://github.com/privacybydesign/irma_keyshare_webclient/compare/v2.0.2...v2.0.3
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "myirma",
"version": "3.1.2",
"version": "3.1.3",
"private": true,
"dependencies": {
"@privacybydesign/yivi-frontend": "^0.1.0",
Expand Down
21 changes: 12 additions & 9 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,22 @@ function handleDeleteAccount({ dispatch }) {
method: 'POST',
credentials: 'include',
})
.then((res) => res.json())
.then((res) => {
if (res.status === 204) {
dispatch({ type: 'logout' });
} else if (res.status === 500 && res.error === 'REVALIDATE_EMAIL') {
dispatch({
type: 'raiseWarning',
explanation: 'delete-account-mail-explanation',
details: 'delete-account-mail-details',
});
} else {
throw res.status;
return res;
}
return res.json().then((resjson) => {
if (res.status === 500 && resjson.error === 'REVALIDATE_EMAIL') {
dispatch({
type: 'raiseWarning',
explanation: 'delete-account-mail-explanation',
details: 'delete-account-mail-details',
});
} else {
throw res.status;
}
});
})
.catch((err) => {
dispatch({ type: 'raiseError', errorMessage: `Error while deleting account: ${err}` });
Expand Down
Loading