Module: OmniAuth::MultiProvider

Defined in:
lib/omni_auth/multi_provider.rb,
lib/omni_auth/multi_provider/handler.rb,
lib/omni_auth/multi_provider/version.rb

Defined Under Namespace

Classes: Handler

Constant Summary collapse

VERSION =
'0.2.1'.freeze

Class Method Summary collapse

Class Method Details

.register(builder, provider_name:, path_prefix: ::OmniAuth.config.path_prefix, **options, &dynamic_options_generator) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/omni_auth/multi_provider.rb', line 8

def self.register(builder,
                  provider_name:,
                  path_prefix: ::OmniAuth.config.path_prefix,
                  **options, &dynamic_options_generator)

  handler = OmniAuth::MultiProvider::Handler.new(path_prefix: path_prefix,
                                                 **options,
                                                 &dynamic_options_generator)

  static_options = options.merge(path_prefix: path_prefix)

  builder.provider(provider_name, static_options.merge(handler.provider_options))
end