module Slots::JWT::GenericMethods

Public Instance Methods

allowed_new_token?() click to toggle source
# File lib/slots/jwt/generic_methods.rb, line 11
def allowed_new_token?
  !(self.class._reject_new_token?(self))
end
authenticate!(password) click to toggle source
# File lib/slots/jwt/generic_methods.rb, line 33
def authenticate!(password)
  raise Slots::JWT::AuthenticationFailed unless self.authenticate?(password)
  true
end
authenticate?(password) click to toggle source
# File lib/slots/jwt/generic_methods.rb, line 27
def authenticate?(password)
  to_return = password.present? && persisted? && respond_to?(:authenticate) && authenticate(password) && allowed_new_token?
  to_return ? successful_login : failed_login
  to_return
end
failed_login() click to toggle source
# File lib/slots/jwt/generic_methods.rb, line 15
def failed_login
  !(self.class._failed_login(self))
end
run_token_created_callback() click to toggle source
# File lib/slots/jwt/generic_methods.rb, line 23
def run_token_created_callback
  self.class._token_created_callback(self)
end
successful_login() click to toggle source
# File lib/slots/jwt/generic_methods.rb, line 19
def successful_login
  !(self.class._successful_login(self))
end