debian-mirror-gitlab/app/controllers/concerns/accepts_pending_invitations.rb

26 lines
559 B
Ruby
Raw Normal View History

2018-12-05 23:21:45 +05:30
# frozen_string_literal: true
2018-11-08 19:23:39 +05:30
module AcceptsPendingInvitations
extend ActiveSupport::Concern
def accept_pending_invitations
return unless resource.active_for_authentication?
2021-06-08 01:23:25 +05:30
if resource.pending_invitations.load.any?
resource.accept_pending_invitations!
clear_stored_location_for_resource
after_pending_invitations_hook
end
end
def after_pending_invitations_hook
# no-op
2018-11-08 19:23:39 +05:30
end
def clear_stored_location_for_resource
session_key = stored_location_key_for(resource)
session.delete(session_key)
end
end