1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00
This commit is contained in:
Sylvain 2021-11-16 10:25:45 +01:00
parent dcea74a026
commit ae969f63ab

View File

@ -52,14 +52,14 @@ module OmniAuth::Strategies
# retrieve data from various url, querying each only once
def raw_info
@raw_info ||= {}
puts "[raw_info] @raw_infos = #{@raw_info}"
puts "[raw_info] @raw_infos = #{@raw_info&.to_json}"
unless @raw_info.size.positive?
OmniAuth::Strategies::SsoOauth2Provider.active_provider.providable.o_auth2_mappings.each do |mapping|
puts "mapping = #{mapping}"
puts "mapping = #{mapping&.to_json}"
unless @raw_info.key?(mapping.api_endpoint.to_sym)
puts "api_endpoint = #{mapping.api_endpoint.to_sym}"
puts "access_token = #{access_token}"
puts "token get = #{access_token.get(mapping.api_endpoint)}"
puts "access_token = #{access_token&.to_json}"
puts "token get = #{access_token.get(mapping.api_endpoint)&.to_json}"
puts "parsed = #{access_token.get(mapping.api_endpoint).parsed}"
@raw_info[mapping.api_endpoint.to_sym] = access_token.get(mapping.api_endpoint).parsed
end
@ -70,6 +70,7 @@ module OmniAuth::Strategies
def parsed_info
@parsed_info ||= {}
puts "[parsed_info] @parsed_info = #{@parsed_info.to_json}"
unless @parsed_info.size.positive?
OmniAuth::Strategies::SsoOauth2Provider.active_provider.providable.o_auth2_mappings.each do |mapping|
@ -100,6 +101,7 @@ module OmniAuth::Strategies
## NO TRANSFORMATION
else
puts "@parsed_info[#{local_sym(mapping)}] found in #{raw_info[mapping.api_endpoint.to_sym]}"
@parsed_info[local_sym(mapping)] = raw_info[mapping.api_endpoint.to_sym][mapping.api_field]
end
end