From c9042a0934282c494de0271c308d1a0a70999e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Mon, 3 Aug 2015 10:41:51 +0200 Subject: [PATCH] delete password of user when submitting to sentry --- .gitignore | 5 ++++- js/actions/user_actions.js | 1 + js/components/ascribe_forms/form.js | 12 ++++++++++-- .../ascribe_uploader/react_s3_fine_uploader.js | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 04138bb0..0270f003 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,10 @@ lib-cov *.out *.pid *.gz - +*.sublime-project +*.sublime-workspace +webapp-dependencies.txt + pids logs results diff --git a/js/actions/user_actions.js b/js/actions/user_actions.js index 44682f17..2a2c3c05 100644 --- a/js/actions/user_actions.js +++ b/js/actions/user_actions.js @@ -22,6 +22,7 @@ class UserActions { this.actions.updateCurrentUser({}); }); } + logoutCurrentUser() { return UserFetcher.logout() .then(() => { diff --git a/js/components/ascribe_forms/form.js b/js/components/ascribe_forms/form.js index 278901a7..0f022a0d 100644 --- a/js/components/ascribe_forms/form.js +++ b/js/components/ascribe_forms/form.js @@ -4,11 +4,12 @@ import React from 'react'; import ReactAddons from 'react/addons'; import Button from 'react-bootstrap/lib/Button'; +import AlertDismissable from './alert'; import requests from '../../utils/requests'; + import { getLangText } from '../../utils/lang_utils'; import { mergeOptionsWithDuplicates } from '../../utils/general_utils'; -import AlertDismissable from './alert'; let Form = React.createClass({ @@ -91,7 +92,14 @@ let Form = React.createClass({ } } else { - console.logGlobal(err, false, this.getFormData()); + let formData = this.getFormData(); + + // sentry shouldn't post the user's password + if(formData.password) { + delete formData.password; + } + + console.logGlobal(err, false, formData); this.setState({errors: [getLangText('Something went wrong, please try again later')]}); } this.setState({submitted: false}); diff --git a/js/components/ascribe_uploader/react_s3_fine_uploader.js b/js/components/ascribe_uploader/react_s3_fine_uploader.js index 1022a090..40f85dc8 100644 --- a/js/components/ascribe_uploader/react_s3_fine_uploader.js +++ b/js/components/ascribe_uploader/react_s3_fine_uploader.js @@ -351,7 +351,7 @@ var ReactS3FineUploader = React.createClass({ }, onError(id, name, errorReason) { - Raven.captureException(errorReason); + Raven.captureException(errorReason, false, this.state.filesToUpload); let notification = new GlobalNotificationModel(this.props.defaultErrorMessage, 'danger', 5000); GlobalNotificationActions.appendGlobalNotification(notification); },