diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-08 12:07:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-08 12:07:36 +0300 |
commit | 7a1235948517e409c00bfe213d43dcd35e614743 (patch) | |
tree | 5576f1cb8336d04870450393b5090abde19b798d /app/controllers | |
parent | dabcc5d12d22ca30d83c986d6ca0b9b81e7ccbfc (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/invites_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/sessions_controller.rb | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/app/controllers/invites_controller.rb b/app/controllers/invites_controller.rb index 8a8ae38c6f3..c058329680a 100644 --- a/app/controllers/invites_controller.rb +++ b/app/controllers/invites_controller.rb @@ -83,8 +83,6 @@ class InvitesController < ApplicationController def authenticate_user! return if current_user - store_location_for(:user, invite_details[:path]) if member - if user_sign_up? set_session_invite_params diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 66ace16400a..afbadc7f4ac 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -16,6 +16,8 @@ class SessionsController < Devise::SessionsController include GoogleSyndicationCSP include PreferredLanguageSwitcher include SkipsAlreadySignedInMessage + include AcceptsPendingInvitations + extend ::Gitlab::Utils::Override skip_before_action :check_two_factor_requirement, only: [:destroy] skip_before_action :check_password_expiration, only: [:destroy] @@ -78,6 +80,8 @@ class SessionsController < Devise::SessionsController flash[:notice] = nil end + accept_pending_invitations + log_audit_event(current_user, resource, with: authentication_method) log_user_activity(current_user) end @@ -94,6 +98,13 @@ class SessionsController < Devise::SessionsController private + override :after_pending_invitations_hook + def after_pending_invitations_hook + member = resource.members.last + + store_location_for(:user, member.source.activity_path) if member + end + def captcha_enabled? request.headers[CAPTCHA_HEADER] && helpers.recaptcha_enabled? end |