Module: Slots::JWT::GenericMethods::ClassMethods
- Defined in:
- lib/slots/jwt/generic_methods.rb
Instance Method Summary collapse
- #_failed_login(user) ⇒ Object
- #_reject_new_token?(user) ⇒ Boolean
- #_successful_login(user) ⇒ Object
- #_token_created_callback(user) ⇒ Object
- #failed_login(&block) ⇒ Object
- #find_for_authentication(login) ⇒ Object
- #reject_new_token(&block) ⇒ Object
- #successful_login(&block) ⇒ Object
- #token_created_callback(&block) ⇒ Object
Instance Method Details
#_failed_login(user) ⇒ Object
57 58 59 |
# File 'lib/slots/jwt/generic_methods.rb', line 57 def _failed_login(user) (@_failed_login ||= []).any? { |b| user.instance_eval(&b) } end |
#_reject_new_token?(user) ⇒ Boolean
50 51 52 |
# File 'lib/slots/jwt/generic_methods.rb', line 50 def _reject_new_token?(user) (@_reject_new_token ||= []).any? { |b| user.instance_eval(&b) } end |
#_successful_login(user) ⇒ Object
64 65 66 |
# File 'lib/slots/jwt/generic_methods.rb', line 64 def _successful_login(user) (@_successful_login ||= []).any? { |b| user.instance_eval(&b) } end |
#_token_created_callback(user) ⇒ Object
71 72 73 |
# File 'lib/slots/jwt/generic_methods.rb', line 71 def _token_created_callback(user) (@_token_created_callback ||= []).each { |b| user.instance_eval(&b) } end |
#failed_login(&block) ⇒ Object
54 55 56 |
# File 'lib/slots/jwt/generic_methods.rb', line 54 def failed_login(&block) (@_failed_login ||= []).push(block) end |
#find_for_authentication(login) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/slots/jwt/generic_methods.rb', line 39 def find_for_authentication(login) Slots::JWT.configuration.logins.each do |k, v| next unless login&.match(v) return find_by(arel_table[k].lower.eq(login.downcase)) || new end new end |
#reject_new_token(&block) ⇒ Object
47 48 49 |
# File 'lib/slots/jwt/generic_methods.rb', line 47 def reject_new_token(&block) (@_reject_new_token ||= []).push(block) end |
#successful_login(&block) ⇒ Object
61 62 63 |
# File 'lib/slots/jwt/generic_methods.rb', line 61 def successful_login(&block) (@_successful_login ||= []).push(block) end |
#token_created_callback(&block) ⇒ Object
68 69 70 |
# File 'lib/slots/jwt/generic_methods.rb', line 68 def token_created_callback(&block) (@_token_created_callback ||= []).push(block) end |