Skip to content

Commit

Permalink
fix(tryLogin): Cast $user to string to prevent unexpected logs due to…
Browse files Browse the repository at this point in the history
… wrong type

Signed-off-by: Simon L. <[email protected]>
  • Loading branch information
szaimen committed Oct 8, 2024
1 parent d7aff6c commit 8f90ff7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/Controller/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ public function tryLogin(Chain $loginChain,
?string $redirect_url = null,
string $timezone = '',
string $timezone_offset = ''): RedirectResponse {
// Cast $user to string to prevent unexpected logs due to wrong type
$user = (string)$user;

Check failure on line 288 in core/Controller/LoginController.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

RedundantCast

core/Controller/LoginController.php:288:11: RedundantCast: Redundant cast to string (see https://psalm.dev/262)
if (!$this->request->passesCSRFCheck()) {
if ($this->userSession->isLoggedIn()) {
// If the user is already logged in and the CSRF check does not pass then
Expand Down

0 comments on commit 8f90ff7

Please sign in to comment.