module NoBrainer::Simple::OAuth2::ResourceOwner

Includes all the required API, associations, validations and callbacks

Public Class Methods

oauth_authenticate(_client, username, password) click to toggle source

Searches for ResourceOwner record with the specific params

@param _client [Object] Client instance @param username [String, to_s] username value (any object that responds to `#to_s`) @param password [String] password value

@return [ResourceOwner, nil] ResourceOwner object or nil if there is no record with such params

# File lib/nobrainer_simple_oauth2/mixins/resource_owner.rb, line 19
def self.oauth_authenticate(_client, username, password)
  user = where(username: username.to_s).first
  user if user && user.encrypted_password == password
end