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

  1. Install the module.
  2. Create a new user.
  3. 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.

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

rajdip_755 created an issue. See original summary.

amandeep123’s picture

Status: Active » Needs review

Hy @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.

rajdip_755’s picture

Hello @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.

amandeep123’s picture

StatusFileSize
new11.38 KB

Hy @rajdip_755 , I Had Mentioned The Screenshot Of The Permission Necessary for Smooth Working Of The Module.

rajdip_755’s picture

StatusFileSize
new1.05 KB
new28.52 KB

Thanks @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.
result

rajdip_755’s picture

Raised the MR to resolve the issue, so please ignore the patch attached in #5 .
Please verify the changes !

manish-31’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new135.56 KB
new120.26 KB

The 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!

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

neerajsingh’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

neerajsingh’s picture