Module: Devise::Models::KillbillAuthenticatable

Extended by:
ActiveSupport::Concern
Defined in:
app/models/kaui/killbill_authenticatable.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#after_killbill_authenticationObject



19
20
21
# File 'app/models/kaui/killbill_authenticatable.rb', line 19

def after_killbill_authentication
  self.save(:validate => false)
end

#valid_killbill_password?(kb_username, kb_password) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
14
15
16
17
# File 'app/models/kaui/killbill_authenticatable.rb', line 8

def valid_killbill_password?(kb_username, kb_password)
  # Simply try to look-up the permissions for that user - this will
  # Take care of the auth part
  response = Kaui::User.find_permissions(kb_username, kb_password)
  # Auth was successful, update the session id
  self.kb_session_id = response.session_id
  true
rescue KillBillClient::API::Unauthorized => _
  false
end