lib/class/Authorization.js
function() {
      var secret;
      if (!this.getSecret()) {
        throw new CError('missing secret').log();
      }
      try {
        secret = this.encoder.encryptRsa(this.getSecret());
      } catch (e) {
        throw new CError({
          body: {
            code: 'ImATeapot',
            message: 'unable to encrypt secret',
            cause: e
          }
        }).log('body');
      }
      if (this.getMode() !== mode1 && this.getMode() !== mode2) {
        throw new CError('unexpected mode').log();
      }
      if (!this.getSid()) {
        throw new CError('missing sid').log();
      }
      return {
        mode: this.getMode(),
        secret: secret,
        sid: this.getSid()
      };
    }
function() {
      var secret;
      if (!this.getSecret()) {
        throw new CError('missing secret').log();
      }
      try {
        secret = this.encoder.encryptRsa(this.getSecret());
      } catch (e) {
        throw new CError({
          body: {
            code: 'ImATeapot',
            message: 'unable to encrypt secret',
            cause: e
          }
        }).log('body');
      }
      if (this.getMode() !== mode1 && this.getMode() !== mode2) {
        throw new CError('unexpected mode').log();
      }
      if (!this.getSid()) {
        throw new CError('missing sid').log();
      }
      return {
        mode: this.getMode(),
        secret: secret,
        sid: this.getSid()
      };
    }
function ( ) { var secret ; if ( ! this . getSecret ( ) ) { throw new CError ( 'missing secret' ) . log ( ) ; } try { secret = this . encoder . encryptRsa ( this . getSecret ( ) ) ; } catch ( e ) { throw new CError ( { body : { code : 'ImATeapot' , message : 'unable to encrypt secret' , cause : e } } ) . log ( 'body' ) ; } if ( this . getMode ( ) !== mode1 && this . getMode ( ) !== mode2 ) { throw new CError ( 'unexpected mode' ) . log ( ) ; } if ( ! this . getSid ( ) ) { throw new CError ( 'missing sid' ) . log ( ) ; } return { mode : this . getMode ( ) , secret : secret , sid : this . getSid ( ) } ; }
Get the payload property of the header.

@return {Object} The payload property of the header
Get the payload property of the header .