lib/submodules/ably-ruby/lib/ably/realtime/auth.rb in ably-rest-0.8.5 vs lib/submodules/ably-ruby/lib/ably/realtime/auth.rb in ably-rest-0.8.6
- old
+ new
@@ -35,10 +35,12 @@
class Auth
extend Forwardable
include Ably::Modules::AsyncWrapper
def_delegators :auth_sync, :client_id
+ def_delegators :auth_sync, :token_client_id_allowed?, :configure_client_id, :client_id_validated?
+ def_delegators :auth_sync, :can_assume_client_id?, :has_client_id?
def_delegators :auth_sync, :current_token_details, :token
def_delegators :auth_sync, :key, :key_name, :key_secret, :options, :auth_options, :token_params
def_delegators :auth_sync, :using_basic_auth?, :using_token_auth?
def_delegators :auth_sync, :token_renewable?, :authentication_security_requirements_met?
def_delegators :client, :logger
@@ -66,9 +68,13 @@
# end
#
def authorise(token_params = {}, auth_options = {}, &success_callback)
async_wrap(success_callback) do
auth_sync.authorise(token_params, auth_options)
+ end.tap do |deferrable|
+ deferrable.errback do |error|
+ client.connection.transition_state_machine :failed, reason: error if error.kind_of?(Ably::Exceptions::IncompatibleClientId)
+ end
end
end
# Synchronous version of {#authorise}. See {Ably::Auth#authorise} for method definition
# @param (see Ably::Auth#authorise)