Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update active date only for users activated and not banned. #1184

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update TokenAuth.php
  • Loading branch information
warcooft authored Aug 26, 2024
commit a4d067ab6a548c61d31da684bd6da7d0feedcc4e
8 changes: 4 additions & 4 deletions src/Filters/TokenAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ public function before(RequestInterface $request, $arguments = null)
->setJSON(['message' => lang('Auth.badToken')]);
}

if (setting('Auth.recordActiveDate')) {
$authenticator->recordActiveDate();
}

// Block inactive users when Email Activation is enabled
$user = $authenticator->getUser();
if ($user !== null && ! $user->isActivated()) {
Expand All @@ -74,6 +70,10 @@ public function before(RequestInterface $request, $arguments = null)
->setStatusCode(Response::HTTP_FORBIDDEN)
->setJSON(['message' => lang('Auth.activationBlocked')]);
}

if (setting('Auth.recordActiveDate')) {
$authenticator->recordActiveDate();
}
}

/**
Expand Down
Loading