Skip to content

Commit

Permalink
Don't raise error on missing omniauth.<key> data
Browse files Browse the repository at this point in the history
This makes it easier to check whether OmniAuth was activated or not.
  • Loading branch information
janko committed Aug 31, 2024
1 parent 159b940 commit dc51817
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rodauth/features/omniauth_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ def route_omniauth!

%w[email name].each do |info_key|
define_method(:"omniauth_#{info_key}") do
omniauth_info[info_key]
omniauth_info[info_key] if omniauth_info
end
end

%w[provider uid info credentials extra].each do |auth_key|
define_method(:"omniauth_#{auth_key}") do
omniauth_auth.fetch(auth_key)
omniauth_auth[auth_key] if omniauth_auth
end
end

%w[auth params strategy origin error error_type error_strategy].each do |data|
define_method(:"omniauth_#{data}") do
request.env.fetch("omniauth.#{data.tr("_", ".")}")
request.env["omniauth.#{data.tr("_", ".")}"]
end
end

Expand Down

0 comments on commit dc51817

Please sign in to comment.