- 🇧🇪Belgium BramDriesen Belgium 🇧🇪
I think we can achieve this with hook_user_login
https://api.drupal.org/api/drupal/core%21modules%21user%21user.api.php/f...
- 🇮🇳India lavanyatalwar
Hi @bramdriesen,
I attempted to use hook_user_login() instead of hook_form_alter(). However, I observed that the module permits both user1 and admin to access the site. Upon further investigation, I discovered that hook_user_login() is triggered after a user has successfully logged in, which may not align with the intended functionality of this module.
Could you please provide your suggestions? - 🇧🇪Belgium BramDriesen Belgium 🇧🇪
Hi @lavanyatalwar
First of all thanks foor looking in depth, and not doing something blindly ;-).
I'm aware that hook_user_login() is happening after the actual login. I guess it's possible to do an forced logout from that point somehow.
- Merge request !13#Issue:3311900-Transition from hook_form_alter to hook_user_login method. → (Open) created by lavanyatalwar
- 🇮🇳India lavanyatalwar
Hi @bramdriesen,
I have transitioned from using hook_form_alter to hook_user_login. According to my tests, all functionalities are working as intended.
Kindly review and merge :) - 🇧🇪Belgium BramDriesen Belgium 🇧🇪
There are test failures. Looks like the forgot password message is not being shown?
Behat\Mink\Exception\ResponseTextException: The text "Unrecognized username or password. Forgot your password?" was not found anywhere in the text of the current page.