class User

An user account.

Public Class Methods

authenticate_signin(signin) click to toggle source

Change this to customize user lookup in the e-mail/password signin process.

For example, to implement Facebook / Twitter's ability to log in using either an e-mail address or a username, look up the user by the username, create a new Session with the e-mail and password, and pass it to super

@param [Session] signin the information entered in the sign-in form @return [User, Symbol] the authenticated user, or a symbol indicating the

reason why the authentication failed
Calls superclass method
# File lib/authpwn_rails/generators/templates/user.rb, line 21
def self.authenticate_signin(signin)
  super
end
create_from_omniauth(omniauth_hash) click to toggle source

Change this to customize on-demand user creation on OmniAuth signup.

This method is called when there is no existing user matching the OmniAuth information, and is responsible for creating a user. It is an opportunity to collect the OmniAuth information to populate the user's account.

The default implementation creates a user with the e-mail matching the 'email' key in the OmniAuth hash. If no e-mail key is present, no User is created.

@param [Hash] omniauth_hash the hash provided by OmniAuth @return [User] a saved User, or nil if the OmniAuth sign-in information

should not be used to create a user
Calls superclass method
# File lib/authpwn_rails/generators/templates/user.rb, line 54
def self.create_from_omniauth(omniauth_hash)
  super
end