Bugfix: Accept pending invitations for registrations via OAuth
What does this MR do and why?
Bug description:
When a new user is invited via email to a group or project, if they accept the invite and sign in via SSO, after login, they will be redirected to 404 page not found
https://gitlab.com/groups/groupname/-/activity
The source of this bug was that users who signed up for GitLab via SSO did not have the group/project invitations accepted automatically.
After a user signs up for GitLab via an emailed invitation link, they are taken to the Project or Group that they were invited to after sign up is complete.
Because Group and Project invitations were not being automatically accepted for SSO users, being redirected to the Project or Group was resulting in errors for these users.
Bug report: #351441 (closed)
Screenshots or screen recordings
With this change, after a user who has been invited to a project signs up for GitLab with OAuth, they are now successfully redirected to https://gitlab.com/groups/groupname/-/activity
with the correct flash message and their invitation has been accepted:
How to set up and validate locally
- Create new private group
example-group
- Invite a user via email
- Click
Join Now
from the email - Click Create Account using
Google
(or Sign in with any other SSO)- Accept Terms if needed
- Taken to
https://gitlab.com/groups/example-group/-/activity
with no error
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.