Problem/Motivation
When a user try to login with the link by the drush uli or login with the basic credentials he/she will face "Access Denied" page, which restrict them to login.
Steps to reproduce
- Install the module.
- Create a new user.
- Try to login with the generated link or login with your credentials.
You may face a messenger related issue at login time, which can be resolved by the given patch of following issue queue. https://www.drupal.org/project/first_time_login/issues/3415376 .
Proposed resolution
At the time of login, there are some core generated query parameter/token passed in the /user/{user_id}/edit/ link, which is not generated due to the module.
As this module is used for showing the update related messages to the user after login, some changes in the redirection flow at login time may resolve the issue.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | after-patch-login.png | 120.26 KB | manish-31 |
| #8 | after-patch.png | 135.56 KB | manish-31 |
| #5 | Screenshot from 2024-04-15 18-42-46.png | 28.52 KB | rajdip_755 |
| #4 | solve.PNG | 11.38 KB | amandeep123 |
Issue fork first_time_login-3440402
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
Comment #2
amandeep123 commentedHy @rajdip_775 ,Thank you for bringing this issue to our attention. We understand that users encounter an "Access Denied" page when attempting to log in via the generated link from Drush ULI or using basic credentials.
To address this issue, we've identified the root cause and proposed a solution. When a user attempts to log in, certain core-generated query parameters or tokens are expected in the "/user/{user_id}/edit/" link, which are not being generated due to the module's behavior.
Given that the primary function of our module is to display update-related messages to users upon login, we recognize the need to adjust the redirection flow during the login process. To resolve this issue, we suggest granting the necessary permissions to users so they can access the edit page seamlessly after logging in.
To implement this solution:
Grant the appropriate permissions to users,BY Going To admin/people/permissions ensuring they have access to the edit page. Then try Logging In With New User, Then You Will See That users can log in without encountering the "Access Denied" page.
If you encounter any further issues or require assistance with permissions settings, please don't hesitate to reach out.
Comment #3
rajdip_755Hello @amandeep_lnwebworks ! Thanks for response.
It will be helpful if you can please mention the particular permission name.
Another thing, I have tried to login with the admin user login credentials then also I faced the same issue, I think the Admin user role has all the permission by default.
Comment #4
amandeep123 commentedHy @rajdip_755 , I Had Mentioned The Screenshot Of The Permission Necessary for Smooth Working Of The Module.
Comment #5
rajdip_755Thanks @amandeep_lnwebworks for providing the exact permission. Your solution is working partially for me.
I have tried with providing the particular permission to all the roles ( which is not recommended in a production site ), and create a user with all the possible roles and try to login. It's working perfectly.
For further testing I've created another user with all the roles and try to login but unfortunately it replicated the same "Access Denied" error.
So that, I have created a patch which is working for me without providing the admin permission also. Please verify the following patch.
And I've attached here the message shown after the login.

Comment #7
rajdip_755Raised the MR to resolve the issue, so please ignore the patch attached in #5 .
Please verify the changes !
Comment #8
manish-31 commentedThe MR patch from #6 works perfectly.. I have confirmed there is no "access denied" error on registration/login after applying this patch.
Attaching the screenshots of registration and login.
Marking this as RTBC. Thanks!
Comment #11
neerajsinghComment #13
neerajsingh