public function custom($value, $name = null) { $value = !is_array($value) ? array($name => $value) : $value; foreach ($value as $type => $value) { $claim = new \Psecio\Jwt\Claim\Custom($value, $type); $this->addClaim($claim); } return $this; }
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(); }