jiggle stuff till it works

This commit is contained in:
Sam 2016-05-27 18:10:01 +10:00
parent 104d79d77e
commit 120e2cfce4
1 changed files with 3 additions and 3 deletions

View File

@ -67,7 +67,7 @@ class OAuth2BasicAuthenticator < ::Auth::OAuth2Authenticator
end
def fetch_user_details(token, id)
user_json_url = SiteSetting.oauth2_user_json_url.sub(':token', token).sub(':id', id)
user_json_url = SiteSetting.oauth2_user_json_url.sub(':token', token.to_s).sub(':id', id.to_s)
log("user_json_url: #{user_json_url}")
@ -87,11 +87,11 @@ class OAuth2BasicAuthenticator < ::Auth::OAuth2Authenticator
end
def after_authenticate(auth)
log("after_authenticate response: \n\ncreds: #{auth['credentials'].to_hash}\ninfo: #{auth['info'].to_hash}\nextra: #{auth['extra'].to_hash}\nid: #{auth[:id]}")
log("after_authenticate response: \n\ncreds: #{auth['credentials'].to_hash}\ninfo: #{auth['info'].to_hash}\nextra: #{auth['extra'].to_hash}")
result = Auth::Result.new
token = auth['credentials']['token']
user_details = fetch_user_details(token, auth[:id])
user_details = fetch_user_details(token, auth['info'][:id])
result.name = user_details[:name]
result.username = user_details[:username]