Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AUT-2108] Update action_code param to action for consistency #16

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading