Skip to content

Commit ebbe893

Browse files
committed
add access token resolving methods to eseye
1 parent 5112869 commit ebbe893

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/Eseye.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
use Psr\Log\LoggerInterface;
2828
use Psr\SimpleCache\CacheInterface;
2929
use Seat\Eseye\Access\AccessInterface;
30+
use Seat\Eseye\Access\AccessTokenRefresher;
31+
use Seat\Eseye\Access\AccessTokenRefresherInterface;
3032
use Seat\Eseye\Access\CheckAccess;
3133
use Seat\Eseye\Containers\EsiAuthentication;
3234
use Seat\Eseye\Containers\EsiResponse;
@@ -151,6 +153,15 @@ public function setAccessChecker(AccessInterface $checker): self
151153
return $this;
152154
}
153155

156+
157+
/**
158+
* @throws InvalidContainerDataException
159+
*/
160+
public function getAccessTokenRefresher(): AccessTokenRefresherInterface
161+
{
162+
return $this->getConfiguration()->getAccessTokenRefresher();
163+
}
164+
154165
/**
155166
* @return \Seat\Eseye\Fetchers\FetcherInterface
156167
*
@@ -536,4 +547,14 @@ public function page(int $page): self
536547

537548
return $this;
538549
}
550+
551+
/**
552+
* @return EsiAuthentication
553+
* @throws InvalidAuthenticationException
554+
* @throws InvalidContainerDataException
555+
*/
556+
public function getValidAccessToken(): EsiAuthentication
557+
{
558+
return $this->getAccessTokenRefresher()->getValidAccessToken($this->getAuthentication());
559+
}
539560
}

0 commit comments

Comments
 (0)