lib/auth/lh/api.rb in auth-lh-0.0.6 vs lib/auth/lh/api.rb in auth-lh-0.0.7
- old
+ new
@@ -41,15 +41,16 @@
end
protected
def create_login_attempt
- result = post_request '/login_attempts', {
- app_code: @application_code,
- return_url: @return_url
- }
+ params = { app_code: @application_code }
- LoginAttempt.new(result)
+ if @return_url
+ params[:return_url] = @return_url
+ end
+
+ LoginAttempt.new(post_request('/login_attempts', params))
end
def get_request(action, params={})
response = RestClient.get("#{@endpoint}#{action}", {params: params}.merge(auth_headers))
JSON.parse(response.body)