fix ie11 account deletion
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import 'url-search-params-polyfill';
|
||||
import 'whatwg-fetch';
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
@@ -6,10 +5,11 @@ const deactivate = (password) => fetch('/api/user/v1/accounts/deactivate_logout/
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
||||
'X-CSRFToken': Cookies.get('csrftoken'),
|
||||
},
|
||||
body: new URLSearchParams({ password }),
|
||||
// URLSearchParams + polyfill doesn't work in IE11
|
||||
body: `password=${encodeURIComponent(password)}`,
|
||||
}).then((response) => {
|
||||
if (response.ok) {
|
||||
return response;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* globals gettext */
|
||||
/* eslint-disable react/no-danger */
|
||||
import React from 'react';
|
||||
import 'whatwg-fetch';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Button, Modal, Icon, InputText, StatusAlert } from '@edx/paragon/static';
|
||||
import StringUtils from 'edx-ui-toolkit/js/utils/string-utils';
|
||||
@@ -46,8 +45,8 @@ class StudentAccountDeletionConfirmationModal extends React.Component {
|
||||
validationErrorDetails: '',
|
||||
}))
|
||||
.catch(error => this.failedSubmission(error))
|
||||
),
|
||||
);
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
failedSubmission(error) {
|
||||
|
||||
5
package-lock.json
generated
5
package-lock.json
generated
@@ -10391,11 +10391,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"url-search-params-polyfill": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/url-search-params-polyfill/-/url-search-params-polyfill-3.0.0.tgz",
|
||||
"integrity": "sha512-oRNWuBkJ/zKKK1aiBaTBZTf07zOKd0g+nJYB+vFNPO14gFjA75BaHgIJLtveWBRxI/2qff7xcTb9H6wkpTmqjg=="
|
||||
},
|
||||
"user-home": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz",
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
"uglify-js": "2.7.0",
|
||||
"underscore": "1.8.3",
|
||||
"underscore.string": "3.3.4",
|
||||
"url-search-params-polyfill": "3.0.0",
|
||||
"webpack": "2.7.0",
|
||||
"webpack-bundle-tracker": "0.2.1",
|
||||
"webpack-merge": "4.1.1",
|
||||
|
||||
Reference in New Issue
Block a user