File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,8 +30,10 @@ def get_consumer
3030 end
3131
3232 def get_user_hash ( access_token )
33- fields = user_info_fields . join ( ',' )
34- response = access_token . get ( "#{ @user_info_path } :(id,#{ fields } )" , 'x-li-format' => 'json' )
33+ # Always include id for provider uid and prevent accidental duplication via setting `user_info_field = ['id']` (needed in Sorcery 0.9.1)
34+ info_fields = user_info_fields ? user_info_fields . reject { |n | n == 'id' } : [ ]
35+ fields = info_fields . any? ? 'id,' + info_fields . join ( ',' ) : 'id'
36+ response = access_token . get ( "#{ @user_info_path } :(#{ fields } )" , 'x-li-format' => 'json' )
3537
3638 auth_hash ( access_token ) . tap do |h |
3739 h [ :user_info ] = JSON . parse ( response . body )
Original file line number Diff line number Diff line change 11module Sorcery
2- VERSION = '0.10.0 '
2+ VERSION = '0.10.1 '
33end
You can’t perform that action at this time.
0 commit comments