-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update omniauth. Fix omniauth not actually being loaded
- Loading branch information
Showing
2 changed files
with
18 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,20 @@ | ||
# use the rails logger for loggin OmniAuth; otherwise it will use std::out | ||
OmniAuth.config.logger = Rails.logger | ||
callme = -> {} | ||
Rails.configuration.after_initialize do | ||
Rails.application.config.middleware.use OmniAuth::Builder do | ||
if Seek::Config.omniauth_enabled | ||
callme = -> { | ||
# To add more providers, see the `omniauth_providers` definition in: `lib/seek/config.rb` | ||
begin | ||
providers = Seek::Config.omniauth_providers | ||
rescue Settings::DecryptionError | ||
providers = [] | ||
end | ||
# To add more providers, see the `omniauth_providers` definition in: `lib/seek/config.rb` | ||
begin | ||
providers = Seek::Config.omniauth_providers | ||
rescue Settings::DecryptionError | ||
providers = [] | ||
end | ||
|
||
providers.each do |key, options| | ||
if options.is_a?(Array) | ||
provider key, *options | ||
else | ||
provider key, options | ||
end | ||
providers.each do |key, options| | ||
if options.is_a?(Array) | ||
provider key, *options | ||
else | ||
provider key, options | ||
end | ||
} | ||
end | ||
end | ||
end | ||
|
||
Rails.application.config.middleware.use OmniAuth::Builder do | ||
callme | ||
end |