mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-02 00:43:34 -04:00
AuthModal handles empty fields, fix #3587
This commit is contained in:
parent
f684708a94
commit
dfd4602553
1 changed files with 7 additions and 1 deletions
|
@ -59,7 +59,7 @@ module.exports = class AuthModal extends ModalView
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
forms.clearFormAlerts(@$el)
|
forms.clearFormAlerts(@$el)
|
||||||
userObject = forms.formToObject @$el
|
userObject = forms.formToObject @$el
|
||||||
res = tv4.validateMultiple userObject, User.schema
|
res = tv4.validateMultiple userObject, formSchema
|
||||||
return forms.applyErrorsToForm(@$el, res.errors) unless res.valid
|
return forms.applyErrorsToForm(@$el, res.errors) unless res.valid
|
||||||
@enableModalInProgress(@$el) # TODO: part of forms
|
@enableModalInProgress(@$el) # TODO: part of forms
|
||||||
loginUser userObject, null, window.nextURL
|
loginUser userObject, null, window.nextURL
|
||||||
|
@ -133,3 +133,9 @@ module.exports = class AuthModal extends ModalView
|
||||||
onHidden: ->
|
onHidden: ->
|
||||||
super()
|
super()
|
||||||
@playSound 'game-menu-close'
|
@playSound 'game-menu-close'
|
||||||
|
|
||||||
|
formSchema = {
|
||||||
|
type: 'object'
|
||||||
|
properties: _.pick(User.schema.properties, 'email', 'password')
|
||||||
|
required: ['email', 'password']
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue