Skip to content

Commit

Permalink
Merge pull request #16 from authsignal/action-code-param
Browse files Browse the repository at this point in the history
[AUT-2108] Update action_code param to action for consistency
  • Loading branch information
aaronzhongg authored Jun 27, 2024
2 parents c1a13ec + 27675de commit 26792f8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
authsignal-ruby (2.0.0)
authsignal-ruby (2.1.0)
httparty (~> 0.21.0)

GEM
Expand Down
4 changes: 2 additions & 2 deletions lib/authsignal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def get_user(user_id:, redirect_url: nil)
response.transform_keys { |key| underscore(key) }.transform_keys(&:to_sym)
end

def get_action(user_id:, action_code:, idempotency_key:)
response = Client.new.get_action(user_id, action_code, idempotency_key)
def get_action(user_id:, action:, idempotency_key:)
response = Client.new.get_action(user_id, action, idempotency_key)
response.transform_keys { |key| underscore(key) }.transform_keys(&:to_sym)
end

Expand Down
4 changes: 2 additions & 2 deletions lib/authsignal/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def validate_challenge(user_id: nil, token:)
handle_response(response)
end

def get_action(user_id, action_code, idempotency_key)
get("/users/#{ERB::Util.url_encode(user_id)}/actions/#{action_code}/#{ERB::Util.url_encode(idempotency_key)}")
def get_action(user_id, action, idempotency_key)
get("/users/#{ERB::Util.url_encode(user_id)}/actions/#{action}/#{ERB::Util.url_encode(idempotency_key)}")
end

def identify(user_id, user_payload)
Expand Down
2 changes: 1 addition & 1 deletion lib/authsignal/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Authsignal
VERSION = "2.0.0"
VERSION = "2.1.0"
end
2 changes: 1 addition & 1 deletion spec/authsignal/authsignal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@

response = Authsignal.get_action(
user_id: 1,
action_code: "testAction",
action: "testAction",
idempotency_key: "15cac140-f639-48c5-92db-835ec8d3d144")


Expand Down

0 comments on commit 26792f8

Please sign in to comment.