lib/omniauth/strategies/vatsim.rb in omniauth-vatsim-0.1.4 vs lib/omniauth/strategies/vatsim.rb in omniauth-vatsim-0.1.5
- old
+ new
@@ -40,9 +40,17 @@
end
# Customize the OAuth request phase to handle VATSIM SSO
def request_phase
request_token = consumer.get_request_token({oauth_callback: callback_url}, options.request_params) do |response_body|
+ # Debug the response body
+ # log :debug, response_body.inspect
+
+ # Log errors
+ if MultiJson.decode(response_body)['request']['result'] == 'fail'
+ log :error, MultiJson.decode(response_body)['request']['message']
+ end
+
# symbolize string keys returned by VATSIM SSO
MultiJson.decode(response_body)['token'].symbolize_keys
end
session['oauth'] ||= {}