Skip to content

Commit

Permalink
Merge pull request #55 from privacybydesign/fix-delete-account
Browse files Browse the repository at this point in the history
Fix: JSON parsing error is shown when deleting account
  • Loading branch information
ivard authored Apr 19, 2024
2 parents fb818d7 + 9bbae31 commit 3c9b260
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 11 deletions.
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

0 comments on commit 3c9b260

Please sign in to comment.