public function getClaim(string $name, $default = null) { if ($this->hasClaim($name)) { return $this->claims[$name]->getValue(); } if ($default === null) { throw new OutOfBoundsException('Requested claim is not configured'); } return $default; }
public function loginByToken(Token $token) { $uid = $token->getClaim('uid'); try { $this->user = $this->usersRepository->getById($uid); } catch (UserNotFoundException $e) { // do nothing here } }