Needs review
Project:
Email Registration
Version:
2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 May 2025 at 02:27 UTC
Updated:
3 Jul 2026 at 05:53 UTC
Jump to comment: Most recent
I'm unable to log in to a site with email OR username login enabled when user entities are not visible to anonymous users.
This is because the Drupal\email_registration\UserAuthentication::lookupAccount method uses an entity query to do the user lookup, and this query has access checking enabled.
Let's disable that access check as this query needs to return a user before we have a logged in user.
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
Comment #2
thtas commentedComment #4
thtas commentedComment #5
estebanvalerio.h commented@thtas I'm not able to reproduce the issue with module version 2.x-dev.
After installing it, I was able to log in with username or email.
I check the code update at https://git.drupalcode.org/project/email_registration/-/merge_requests/5... and compare it with the code on my environment, the accessCheck is set to TRUE and this wasn't a blocker to log in
Can you specify which steps to follow to reproduce the issue? Thanks
Comment #6
thtas commentedThe issue arises when some modules need to have a say on the query access for user entities.
e.g. in my scenario, I have a site which uses the groups module which will implement query level access and is configured in such a way that users are not visible to anonymous users.
This could also happen if you used the "entity" module and implemented a query access handler for user entities.
Also, the parent call from the core class that this class extends from will also skip access checking as it uses the entity storage loadByProperties method.
Comment #7
jonathanshawYes, this is the correct approach.
Comment #8
gregglesNeeds work for that comment on the MR.
Comment #10
santanu mondal commented