module Authenticate::Model::Username
Use :username as the identifier for the user. Username
must be unique.
Columns¶ ↑
-
username - the username of your user
Validations¶ ↑
-
:username requires username is set, ensure it is unique
class methods¶ ↑
-
credentials(params) - return the credentials required for authorization by username
-
authenticate(credentials) - find user with given username, validate their password, return user if authenticated
-
find_by_credentials(credentials) - find and return the user with the username in the credentials
Public Class Methods
required_fields(_klass)
click to toggle source
# File lib/authenticate/model/username.rb, line 20 def self.required_fields(_klass) [:username, :email] end