Skip to content

Commit

Permalink
fixup! authorise arguments do not merge with existing values, but ins…
Browse files Browse the repository at this point in the history
…tead replace them
  • Loading branch information
mattheworiordan committed Apr 28, 2016
1 parent 9612fac commit dfc97f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/ably/auth.rb
Expand Up @@ -125,9 +125,9 @@ def initialize(client, token_params, auth_options)
#
def authorise(token_params = nil, auth_options = nil)
if auth_options == { force: true }
auth_options = @options.merge(force: true)
auth_options = options.merge(force: true)
elsif auth_options.nil?
auth_options = @options
auth_options = options
else
ensure_valid_auth_attributes auth_options

Expand Down Expand Up @@ -519,8 +519,8 @@ def split_api_key_into_key_and_secret!(options)
end

def store_and_delete_basic_auth_key_from_options!(options)
@key_name = options[:key_name]
@key_secret = options[:key_secret]
@key_name = options.delete(:key_name)
@key_secret = options.delete(:key_secret)
end

# Returns the current token if it exists or authorises and retrieves a token
Expand Down
4 changes: 2 additions & 2 deletions lib/ably/realtime/auth.rb
Expand Up @@ -67,7 +67,7 @@ def initialize(client)
# token_details #=> Ably::Models::TokenDetails
# end
#
def authorise(token_params = {}, auth_options = {}, &success_callback)
def authorise(token_params = nil, auth_options = nil, &success_callback)
async_wrap(success_callback) do
auth_sync.authorise(token_params, auth_options, &method(:upgrade_authentication_block).to_proc)
end.tap do |deferrable|
Expand All @@ -82,7 +82,7 @@ def authorise(token_params = {}, auth_options = {}, &success_callback)
# @option (see Ably::Auth#authorise)
# @return [Ably::Models::TokenDetails]
#
def authorise_sync(token_params = {}, auth_options = {})
def authorise_sync(token_params = nil, auth_options = nil)
auth_sync.authorise(token_params, auth_options, &method(:upgrade_authentication_block).to_proc)
end

Expand Down

0 comments on commit dfc97f0

Please sign in to comment.