use ParagonIE\ConstantTime\Base64UrlSafe;
use ParagonIE\ConstantTime\Hex;
use Psr\Http\Client\ClientExceptionInterface;
+use Psr\Http\Message\ResponseInterface;
use wcf\system\exception\NamedUserException;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\io\HttpFactory;
$accessToken = $this->codeToAccessToken($_GET['code']);
$oauthUser = $this->getUser($accessToken);
- $this->processUser($oauthUser);
+ $result = $this->processUser($oauthUser);
} elseif (isset($_GET['error'])) {
- $this->handleError($_GET['error']);
+ $result = $this->handleError($_GET['error']);
} else {
- $this->initiate();
+ $result = $this->initiate();
+ }
+
+ if ($result instanceof ResponseInterface) {
+ return $result;
}
} catch (NamedUserException | PermissionDeniedException $e) {
throw $e;