Skip to content

Commit

Permalink
Apply changes from 28119e9 (merge commit), accompanied with minor cle…
Browse files Browse the repository at this point in the history
…anup
  • Loading branch information
dannon committed Sep 19, 2020
1 parent 34e6249 commit 0e406df
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions client/src/components/User/UserPreferences.vue
Original file line number Diff line number Diff line change
Expand Up @@ -242,23 +242,22 @@ export default {
},
async handleSubmit() {
const Galaxy = getGalaxyInstance();
const userId = Galaxy.user.id;
if (!this.checkFormValidity()) {
return false;
}
var email = Galaxy.user.email;
var userId = Galaxy.user.id;
if (this.email === this.name) {
this.nameState = true;
try {
await axios.delete(`${getAppRoot()}api/users/${userId}`);
} catch {
// TODO: actually inspect the response for an error code, don't just assume this was the issue.
this.deleteError =
"User deletion must be configured on this instance in order to allow user self-deletion. Please contact an administrator for assistance.";
return false;
} catch (e) {
if (e.response.status === 403) {
this.deleteError =
"User deletion must be configured on this instance in order to allow user self-deletion. Please contact an administrator for assistance.";
return false;
}
}
window.location.href = `${getAppRoot()}user/logout?session_csrf_token=${Galaxy.session_csrf_token}`;
window.location.href = `${getAppRoot()}`;
} else {
this.nameState = false;
return false;
Expand Down

0 comments on commit 0e406df

Please sign in to comment.