diff --git a/api/user.go b/api/user.go index 513c39b968..7d2eb85bfe 100644 --- a/api/user.go +++ b/api/user.go @@ -455,8 +455,8 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) { if result := <-Srv.Store.User().Get(id); result.Err != nil { c.LogAuditWithUserId(user.Id, "failure") - //c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, result.Err.Error()) - c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "") + c.Err = result.Err + c.Err.StatusCode = http.StatusBadRequest return } else { user = result.Data.(*model.User) @@ -466,8 +466,7 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) { if user, err = getUserForLogin(loginId, ldapOnly); err != nil { c.LogAudit("failure") - //c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, err.Error()) - c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "") + c.Err = err return } @@ -477,12 +476,7 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) { // and then authenticate them if user, err = authenticateUser(user, password, mfaToken); err != nil { c.LogAuditWithUserId(user.Id, "failure") - //c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, err.Error()) - if err.Id == "api.user.login.not_verified.app_error" { - c.Err = err - } else { - c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "") - } + c.Err = err return } diff --git a/i18n/de.json b/i18n/de.json index 289cec3b67..17691b02be 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -165,7 +165,7 @@ }, { "id": "api.channel.add_user.to.channel.failed.deleted.app_error", - "translation": "Failed to add user to channel because they have been removed from the team." + "translation": "Fehler beim Hinzufügen des Benutzers zum Kanal, da dieser aus dem Team entfernt worden ist." }, { "id": "api.channel.add_user_to_channel.deleted.app_error", diff --git a/i18n/en.json b/i18n/en.json index f8dddfc0b0..245ae8d832 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1761,7 +1761,7 @@ }, { "id": "api.user.login.invalid_credentials", - "translation": "Your login credentials are incorrect." + "translation": "User ID or password incorrect." }, { "id": "api.user.login.not_provided.app_error", diff --git a/i18n/es.json b/i18n/es.json index 30ea90ad5d..9ea63a7d05 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -165,7 +165,7 @@ }, { "id": "api.channel.add_user.to.channel.failed.deleted.app_error", - "translation": "Failed to add user to channel because they have been removed from the team." + "translation": "Error al agregar el usuario al canal porque ha sido removido del equipo." }, { "id": "api.channel.add_user_to_channel.deleted.app_error", diff --git a/webapp/components/admin_console/file_upload_setting.jsx b/webapp/components/admin_console/file_upload_setting.jsx index e7cb387ee8..a7df16c0af 100644 --- a/webapp/components/admin_console/file_upload_setting.jsx +++ b/webapp/components/admin_console/file_upload_setting.jsx @@ -18,7 +18,8 @@ export default class FileUploadSetting extends Setting { uploadingText: React.PropTypes.node, onSubmit: React.PropTypes.func.isRequired, disabled: React.PropTypes.bool, - fileType: React.PropTypes.string.isRequired + fileType: React.PropTypes.string.isRequired, + error: React.PropTypes.string }; } @@ -29,7 +30,8 @@ export default class FileUploadSetting extends Setting { this.handleSubmit = this.handleSubmit.bind(this); this.state = { - fileName: null + fileName: null, + serverError: props.error }; } diff --git a/webapp/components/admin_console/remove_file_setting.jsx b/webapp/components/admin_console/remove_file_setting.jsx index 5a76faae2f..9a6266a626 100644 --- a/webapp/components/admin_console/remove_file_setting.jsx +++ b/webapp/components/admin_console/remove_file_setting.jsx @@ -23,28 +23,18 @@ export default class RemoveFileSetting extends Setting { constructor(props) { super(props); this.handleRemove = this.handleRemove.bind(this); - - this.state = { - serverError: null - }; } handleRemove(e) { e.preventDefault(); $(this.refs.remove_button).button('loading'); - this.props.onSubmit(this.props.id, (error) => { + this.props.onSubmit(this.props.id, () => { $(this.refs.remove_button).button('reset'); - this.setState({serverError: error}); }); } render() { - let serverError; - if (this.state.serverError) { - serverError =
; - } - return (