# File lib/omniauth/strategies/draugiem.rb, line 46 def callback_phase if request.params['dr_auth_status'] == 'ok' && request.params['dr_auth_code'] response = RestClient.get('http://api.draugiem.lv/json/', { :params => draugiem_authorize_params(request.params['dr_auth_code']) }) auth = MultiJson.decode(response.to_s) unless auth['error'] @auth_data = auth super else fail!(auth['error']['code'].to_s,auth["error"]["description"].to_s) end else fail!(:invalid_request) end rescue Exception => e fail!(:invalid_response, e) end