Problem/Motivation

Users blocked by flood gets a 500 when attempting to log in.

AssertionError: Cannot load the "user" entity with NULL ID. in assert() (line 246 of /app/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php)

Steps to reproduce

Submit the login form using a username or from an IP which is blocked by flood.

Proposed resolution

Check the UID exists before attempting to load the user in the "submitForm" method. (same as Drupal core user module)

Remaining tasks

Add code to check if the a uid exists in form state.

CommentFileSizeAuthor
#2 3032041-tfa-check_uid_exists-2.patch618 bytesAndrew211

Issue fork tfa-3230114

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Andrew211 created an issue. See original summary.

Andrew211’s picture

StatusFileSize
new618 bytes

Here's a patch to check the uid exists in the form state before attempting to load the user.

Same as how the core user module Drupal\user\Form\UserLoginForm::submitForm handles submit.

Andrew211’s picture

Issue summary: View changes

alexverb made their first commit to this issue’s fork.

alexverb’s picture

Status: Needs review » Closed (duplicate)

Apparently this was released already in https://www.drupal.org/node/3205297