feat: setup invite to handle SAML enabled account [CW-5613] (#12439)
This commit is contained in:
13
enterprise/app/builders/enterprise/agent_builder.rb
Normal file
13
enterprise/app/builders/enterprise/agent_builder.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
module Enterprise::AgentBuilder
|
||||
def perform
|
||||
super.tap do |user|
|
||||
convert_to_saml_provider(user) if user.persisted? && account.saml_enabled?
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def convert_to_saml_provider(user)
|
||||
user.update!(provider: 'saml') unless user.provider == 'saml'
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user