Skip to content

Commit

Permalink
Fix potential type error
Browse files Browse the repository at this point in the history
  • Loading branch information
campbell-m committed Apr 24, 2024
1 parent d84ec3e commit 53ad0fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/lib/MRBS/Session/SessionWithLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ protected function getValidUser(
#[\SensitiveParameter]
?string $password) : string
{
if (($valid_username = auth()->validateUser($this->form['username'], $this->form['password'])) === false)
if (!isset($this->form['password']) ||
(($valid_username = auth()->validateUser($this->form['username'], $this->form['password'])) === false))
{
$this->authGet($this->form['target_url'], $this->form['returl'], get_vocab('unknown_user'));
exit(); // unnecessary because authGet() exits, but just included for clarity
Expand Down

0 comments on commit 53ad0fd

Please sign in to comment.