code: function validate(closed) {
      if (closed) return;
  
      var username = $('.modal input[name="username"]')
        , password = $('.modal input[name="password"]')
        , button = $('.modal button[type="submit"]')
        , self = this;
  
      // Add an disabled state to the button as we are processing it
      button.addClass('disabled loading')
        .set('disabled', 'disabled')
        .set('innerHTML', 'Logging in');
  
      username = username.set('readOnly', true).get('value');
      password = password.set('readOnly', true).get('value');
  
      // Show the spinner.
      $('.modal .close').addClass('gone');
      $('.modal .spinner').removeClass('gone');
  
      Cortex.request({
          url: '/signin/verify'
        , method: 'post'
        , type: 'json'
        , data: {
              username: username
            , password: password
          }
        , success: function success(res) {
            if (res.status === 'error') return self.render('login', {
                error: res.message
              , username: username
              , password: password
            });
  
            $('.modal form').plain(0).submit();
          }
      });
  
      return this;
    }
docs: Validate the login credentials.
  
  @param {Boolean} closed the user closed modal
  @api private