Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/concerns/accepts_pending_invitations.rb')
-rw-r--r--app/controllers/concerns/accepts_pending_invitations.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/controllers/concerns/accepts_pending_invitations.rb b/app/controllers/concerns/accepts_pending_invitations.rb
index 5601b7a7f79..53dec698fa0 100644
--- a/app/controllers/concerns/accepts_pending_invitations.rb
+++ b/app/controllers/concerns/accepts_pending_invitations.rb
@@ -3,12 +3,12 @@
module AcceptsPendingInvitations
extend ActiveSupport::Concern
- def accept_pending_invitations
- return unless resource.active_for_authentication?
+ def accept_pending_invitations(user: resource)
+ return unless user.active_for_authentication?
- if resource.pending_invitations.load.any?
- resource.accept_pending_invitations!
- clear_stored_location_for_resource
+ if user.pending_invitations.load.any?
+ user.accept_pending_invitations!
+ clear_stored_location_for(user: user)
after_pending_invitations_hook
end
end
@@ -17,8 +17,8 @@ module AcceptsPendingInvitations
# no-op
end
- def clear_stored_location_for_resource
- session_key = stored_location_key_for(resource)
+ def clear_stored_location_for(user:)
+ session_key = stored_location_key_for(user)
session.delete(session_key)
end