mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Fix StudentLoginModal when email or password is not included
This commit is contained in:
parent
f7f405b774
commit
65dd571041
1 changed files with 3 additions and 5 deletions
|
@ -20,13 +20,11 @@ module.exports = class StudentSignInModal extends ModalView
|
|||
@login()
|
||||
|
||||
login: ->
|
||||
userObject = forms.formToObject @$el
|
||||
res = tv4.validateMultiple userObject, User.schema
|
||||
return forms.applyErrorsToForm(@$el, res.errors) unless res.valid
|
||||
data = forms.formToObject @$el
|
||||
@enableModalInProgress(@$el)
|
||||
auth.loginUser userObject, (jqxhr) =>
|
||||
auth.loginUser data, (jqxhr) =>
|
||||
error = jqxhr.responseJSON[0]
|
||||
message = error.property + ' ' + error.message
|
||||
message = _.filter([error.property, error.message]).join(' ')
|
||||
@disableModalInProgress(@$el)
|
||||
@$('#errors-alert').text(message).removeClass('hide')
|
||||
|
Loading…
Reference in a new issue