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



26
27
28
# File 'app/models/kaui/killbill_authenticatable.rb', line 26

def after_killbill_authentication
  save(validate: false)
end

#valid_killbill_password?(creds) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
18
19
20
21
22
23
24
# File 'app/models/kaui/killbill_authenticatable.rb', line 15

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