createJWT(payload) {
    payload.jti = this.uuid(); // JWT id
    payload.iss = this.yggdrasil.config.iss; // issuer identifier (identity of this instance of the yggdrasil

    const signedJWT = this.jwtLib.sign(payload, this.yggdrasil.config.JWTSecret, {
      expiresIn: this.yggdrasil.config.sessions.duration
    });

    return this.yggdrasil.storageService.setCache({
      key: this.sessionId(payload.jti, payload.iss),
      body: signedJWT,
      options: {
        ttl: this.yggdrasil.config.sessions.durationSeconds
      }
    })
      .then(() => {
        return signedJWT;
      });
  }
/**
   * Create a JWT and Store it into cache to keep a record on non revoked ones
   * @param payload
   * @returns {Promise<*>}
   */
Create a JWT and Store it into cache to keep a record on non revoked ones
@param payload
@returns {Promise<*>}
Create a JWT and Store it into cache to keep a record on non revoked ones @param payload @returns { Promise< * > }
createJWT(payload) {
    payload.jti = this.uuid(); 
    payload.iss = this.yggdrasil.config.iss; 
    const signedJWT = this.jwtLib.sign(payload, this.yggdrasil.config.JWTSecret, {
      expiresIn: this.yggdrasil.config.sessions.duration
    });
    return this.yggdrasil.storageService.setCache({
      key: this.sessionId(payload.jti, payload.iss),
      body: signedJWT,
      options: {
        ttl: this.yggdrasil.config.sessions.durationSeconds
      }
    })
      .then(() => {
        return signedJWT;
      });
  }
createJWT ( payload ) { payload . jti = this . uuid ( ) ; payload . iss = this . yggdrasil . config . iss ; const signedJWT = this . jwtLib . sign ( payload , this . yggdrasil . config . JWTSecret , { expiresIn : this . yggdrasil . config . sessions . duration } ) ; return this . yggdrasil . storageService . setCache ( { key : this . sessionId ( payload . jti , payload . iss ) , body : signedJWT , options : { ttl : this . yggdrasil . config . sessions . durationSeconds } } ) . then ( ( ) => { return signedJWT ; } ) ; }
Create a JWT and Store it into cache to keep a record on non revoked ones
 @param payload
 @returns {Promise<*>}
Create a JWT and Store it into cache to keep a record on non revoked ones @param payload @returns { Promise< * > }
// JWT id // issuer identifier (identity of this instance of the yggdrasil