Skip to content

Commit

Permalink
Merge pull request #88 from xprojects-de/development
Browse files Browse the repository at this point in the history
optimization on auth error - read username
  • Loading branch information
xprojects-de authored Oct 25, 2024
2 parents d779929 + 47b553d commit 218955b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Security/AlpdeskcoreTokenAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio

$data = ['type' => AlpdeskCoreConstants::$ERROR_INVALID_AUTH, 'username' => $username, 'message' => \strtr($exception->getMessage(), $exception->getMessageData())];

$logEntry = 'Username:' . $username . ' => ' . \strtr($exception->getMessage(), $exception->getMessageData());
$logEntry = \strtr($exception->getMessage(), $exception->getMessageData());
if (\is_string($username) && $username !== '') {
$logEntry .= ' (Username: ' . $username . ')';
}

$this->logger->error($logEntry, __METHOD__);

return new JsonResponse($data, Response::HTTP_FORBIDDEN);
Expand Down

0 comments on commit 218955b

Please sign in to comment.