module AppRail::Airtable::Authenticatable
Public Class Methods
included(klass)
click to toggle source
# File lib/app_rail/airtable/authenticatable.rb, line 9 def self.included(klass) klass.extend(ClassMethods) klass.prepend(InstanceMethods) # prepends `initialize` instance method in order to take precedence over Airrecord::Table#initialize end
Public Instance Methods
oauth_session()
click to toggle source
# File lib/app_rail/airtable/authenticatable.rb, line 66 def oauth_session { access_token: self["Access Token"], scope: :user, refresh_token: "", token_type: :bearer, expires_in: 60000 } end
password_hash()
click to toggle source
# File lib/app_rail/airtable/authenticatable.rb, line 62 def password_hash self["Password Hash"] end
valid_password?(password)
click to toggle source
# File lib/app_rail/airtable/authenticatable.rb, line 58 def valid_password?(password) BCrypt::Password.new(password_hash) == password end