Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ class ilAuthFrontend

private ilUserProfile $user_profile;

private bool $authenticated = false;

/**
* @param ilAuthSession $session
* @param ilAuthStatus $status
Expand Down Expand Up @@ -292,13 +290,20 @@ protected function handleAuthenticationSuccess(ilAuthProviderInterface $provider
}

// check if profile is complete
if (
$this->user_profile->isProfileIncomplete($user) &&
ilAuthFactory::getContext() !== ilAuthFactory::CONTEXT_ECS &&
ilContext::getType() !== ilContext::CONTEXT_LTI_PROVIDER
) {
$profile_incomplete = ilAuthFactory::getContext() !== ilAuthFactory::CONTEXT_ECS
&& ilContext::getType() !== ilContext::CONTEXT_LTI_PROVIDER
&& $this->user_profile->isProfileIncomplete($user);
if ($profile_incomplete) {
ilLoggerFactory::getLogger('auth')->info('User profile is incomplete.');
$user->setProfileIncomplete(true);
}

$has_login_attempts = $user->getLoginAttempts() > 0;
if ($has_login_attempts) {
$user->setLoginAttempts(0);
}

if ($profile_incomplete || $has_login_attempts) {
$user->update();
}

Expand All @@ -322,12 +327,6 @@ protected function handleAuthenticationSuccess(ilAuthProviderInterface $provider
}
$user->refreshLogin();

if ($user->getLoginAttempts() > 0) {
$user->setLoginAttempts(0);
$user->update();
}


$this->logger->info('Successfully authenticated: ' . ilObjUser::_lookupLogin($this->getStatus()->getAuthenticatedUserId()));
$this->getAuthSession()->setAuthenticated(true, $this->getStatus()->getAuthenticatedUserId());

Expand Down
Loading