public function generateAuthToken($user)
 {
     $header = new JwtHeader($this->getAuthKey());
     $jwt = new Jwt($header);
     $jwt->custom($this->getAuthOptions());
     $jwt->issuer($this->getForestUri())->issuedAt(time())->notBefore(time() + 60)->expireTime(time() + 3600)->jwtId($user->id);
     return $jwt->encode();
 }
 public function getTokenData($token)
 {
     $jwt = new Jwt\Jwt(new Jwt\Header('starfish'));
     return $jwt->decode($token);
 }