 usernameFormMessages = new FormMessages()
-passwordFormMessages = new FormMessages()
-passwordReadyForValidation = false
-passwordFieldModified = false
 usernameReadyForValidation = false
 usernameFieldModified = false
+
+passwordFormMessages = new FormMessages()
+newPasswordReadyForValidation = false
+newPasswordFieldModified = false
 
 resetUsernameForm = ->
   usernameFormMessages.resetMessages()
   usernameReadyForValidation = false
+  usernameFieldModified = false
 
 resetPasswordForm = ->
   passwordFormMessages.resetMessages()
   $('#current-password').val('')
   $('#new-password').val('')
-  passwordReadyForValidation = false
+  newPasswordReadyForValidation = false
+  newPasswordFieldModified = false
 
 # Reset forms when settings page becomes active
 Deps.autorun ->

  !passwordFormMessages.getErrorMessage field

validatePassword = (newPassword, messageField) ->
  return unless passwordReadyForValidation
  try
    User.validatePassword newPassword, messageField
    passwordFormMessages.resetMessages messageField

# Password settings
Template.settingsPassword.events =
  'click button.change-password': (event, template) ->
    newPasswordReadyForValidation = true
    passwordFormMessages.resetMessages()
    event.preventDefault()
    currentPassword = $('#current-password').val()
