diff --git a/Classes/Service/OAuthService.php b/Classes/Service/OAuthService.php index f77a310..ad163f4 100644 --- a/Classes/Service/OAuthService.php +++ b/Classes/Service/OAuthService.php @@ -68,7 +68,7 @@ public function getAuthorizationUrl(array $options = []): string if (!empty($this->settings['oidcAuthorizeLanguageParameter'])) { $languageOption = $this->settings['oidcAuthorizeLanguageParameter']; if (!empty($languageOption)) { - $language = $this->getTSFE()->getLanguage()->getTwoLetterIsoCode(); + $language = $this->getTSFE() ? $this->getTSFE()->getLanguage()->getTwoLetterIsoCode() : 'en'; $options[$languageOption] = $language; } } @@ -271,8 +271,8 @@ protected function getRedirectUrl(): string return $this->settings['oidcRedirectUri'] ?: GeneralUtility::getIndpEnv('TYPO3_SITE_URL'); } - protected function getTSFE(): TypoScriptFrontendController + protected function getTSFE(): ? TypoScriptFrontendController { - return $GLOBALS['TSFE']; + return $GLOBALS['TSFE'] ?? null; } }