public function getToken(UserSession $user): Token
    {
        // @todo Test that the expiresAfter() call works. We don't want to be caught
        // by cron etc.
        $item = $this->cacheItemPool->getItem($this->cacheKey($user));

        if (!$item->isHit()) {
            throw new TokenNotFoundException($user);
        }

        return $item->get();
    }
public function getToken(UserSession $user): Token
    {
        // @todo Test that the expiresAfter() call works. We don't want to be caught
        // by cron etc.
        $item = $this->cacheItemPool->getItem($this->cacheKey($user));

        if (!$item->isHit()) {
            throw new TokenNotFoundException($user);
        }

        return $item->get();
    }
public function getToken ( UserSession $ user ) : Token { // @todo Test that the expiresAfter() call works. We don't want to be caught // by cron etc. $ item = $ this -> cacheItemPool -> getItem ( $ this -> cacheKey ( $ user ) ) ; if ( ! $ item -> isHit ( ) ) { throw new TokenNotFoundException ( $ user ) ; } return $ item -> get ( ) ; }
Get the cached token for a user.

@param \Lullabot\Mpx\Service\IdentityManagement\UserSession $user The user to look up tokens for.

@return \Lullabot\Mpx\Token The cached token.
Get the cached token for a user .