mirror of
https://github.com/czhu12/canine.git
synced 2025-12-17 00:44:33 -06:00
21 lines
566 B
Ruby
21 lines
566 B
Ruby
# frozen_string_literal: true
|
|
|
|
module SSOProviders
|
|
class SaveConfiguration
|
|
extend LightService::Action
|
|
expects :sso_provider, :configuration
|
|
|
|
executed do |context|
|
|
context.sso_provider.configuration = context.configuration
|
|
|
|
unless context.configuration.save
|
|
context.fail_and_return!("Failed to save configuration", errors: context.configuration.errors)
|
|
end
|
|
|
|
unless context.sso_provider.save
|
|
context.fail_and_return!("Failed to save SSO provider", errors: context.sso_provider.errors)
|
|
end
|
|
end
|
|
end
|
|
end
|