Skip to content

Commit

Permalink
Update omniauth. Fix omniauth not actually being loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
fbacall committed Dec 13, 2024
1 parent e0c9225 commit 8b5105b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
8 changes: 5 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ GEM
activerecord (>= 4.0)
autoprefixer-rails (10.4.13.0)
execjs (~> 2)
base64 (0.2.0)
bcp47 (0.3.3)
i18n
better_errors (2.9.1)
Expand Down Expand Up @@ -512,7 +513,7 @@ GEM
octokit (6.1.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
omniauth (2.1.0)
omniauth (2.1.2)
hashie (>= 3.4.6)
rack (>= 2.2.3)
rack-protection
Expand Down Expand Up @@ -585,8 +586,9 @@ GEM
httpclient
json-jwt (>= 1.11.0)
rack (>= 2.1.0)
rack-protection (2.2.2)
rack
rack-protection (3.2.0)
base64 (>= 0.1.0)
rack (~> 2.2, >= 2.2.4)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.7.2)
Expand Down
33 changes: 13 additions & 20 deletions config/initializers/seek_omniauth.rb
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

0 comments on commit 8b5105b

Please sign in to comment.