Skip to content

Commit

Permalink
[TASK] Reorder methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Wessels committed Sep 11, 2019
1 parent 8649e77 commit f345f6a
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions Classes/Service/AuthenticationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,30 @@ protected function isResponsible(): bool
return $responsible;
}

/**
* @throws \TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException
* @throws \TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException
*/
protected function initApplication()
{
if ($this->environmentService->isEnvironmentInFrontendMode()) {
$this->logger->notice('Handle frontend login.');
$this->application = (int)GeneralUtility::_GP('application');
$this->tableName = 'fe_users';
} elseif ($this->environmentService->isEnvironmentInBackendMode()) {
$this->logger->notice('Handle backend login.');
$emConfiguration = new EmAuth0Configuration();
$this->application = $emConfiguration->getBackendConnection();
$this->tableName = 'be_users';
} else {
$this->logger->error('Environment is neither in frontend nor in backend mode');
}

if ($this->application === 0 && $this->initSessionStore() === false) {
$this->logger->error('No Auth0 application UID given.');
}
}

protected function setDefaults(array $authInfo, string $mode, array $loginData, AbstractUserAuthentication $pObj)
{
$authInfo['db_user']['check_pid_clause'] = false;
Expand Down Expand Up @@ -284,30 +308,6 @@ protected function initializeAuth0Connections(): bool
return false;
}

/**
* @throws \TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException
* @throws \TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException
*/
protected function initApplication()
{
if ($this->environmentService->isEnvironmentInFrontendMode()) {
$this->logger->notice('Handle frontend login.');
$this->application = (int)GeneralUtility::_GP('application');
$this->tableName = 'fe_users';
} elseif ($this->environmentService->isEnvironmentInBackendMode()) {
$this->logger->notice('Handle backend login.');
$emConfiguration = new EmAuth0Configuration();
$this->application = $emConfiguration->getBackendConnection();
$this->tableName = 'be_users';
} else {
$this->logger->error('Environment is neither in frontend nor in backend mode');
}

if ($this->application === 0 && $this->initSessionStore() === false) {
$this->logger->error('No Auth0 application UID given.');
}
}

/**
* @return bool|mixed
*/
Expand Down

0 comments on commit f345f6a

Please sign in to comment.