User accept invitation access denied

Created on 12 March 2025, 25 days ago

Problem/Motivation

When an invite is sent to a user with an existing account, if they are not already logged in to the site and they click the link in the email, they get "You are not authorised to access this page." This is poor UX.

The email includes the text:

If you wish to accept the invitation, go to the My invitations tab in your user profile.
Please visit the following address in order to do so: http://example.com/user/group-invitations?user=30.

However, the url /user/group-invitations (the My Invitations view) is not accessible unless the user has already logged in.

I'm using Drupal 10.4.4, Group 3.3.4, Group Invite 4.0.0.

Steps to reproduce

Send a group invite to a user with an account on the site. Click the link in the email without already being logged in.

Proposed resolution

People shouldn't be pointed directly to the group-invitations page. Instead they should simply be pointed to the login page. The email text should say something like:

If you wish to accept the invitation, go to the My invitations tab in your user profile.
Please log in to the site in order to do so: http://example.com/user.

When the user logs in, I believe they'll see a message saying they have a pending invitation, and prompting them to visit their invitations page.

Remaining tasks

Implement the change.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024