code: function() {
          var model = this;
          var request = AVRequest('login', null, null, 'POST', this.toJSON());
          return request.then(function(resp) {
            var serverAttrs = model.parse(resp);
            model._finishFetch(serverAttrs);
            return model._handleSaveResult(true).then(function() {
              if (!serverAttrs.smsCode) delete model.attributes['smsCode'];
              return model;
            });
          });
        }
docs: Logs in a AV.User. On success, this saves the session to localStorage,
  so you can retrieve the currently logged in user using
  <code>current</code>.
  
  <p>A username and password must be set before calling logIn.</p>
  
  @see AV.User.logIn
  @return {Promise} A promise that is fulfilled with the user when
  the login is complete.