Workout With Friends
Stay fit with a little motivation
 All Classes Namespaces Files Functions Variables Properties
Static Public Member Functions | List of all members
wowf.lib.auth.Auth Class Reference
Collaboration diagram for wowf.lib.auth.Auth:
Collaboration graph

Static Public Member Functions

def send_invite
 Send invitations to the given emails on behalf of the user, if given, or on behalf of the system.
def check_invite
 Check if the token is valid, and thus if the user is allowed to register.
def register
 Provide the user with the minimum privileges necessary to access the system.
def check_login
 Check the email/password combo, and whether the user has privileges necessary to access the system.
def login
 Start a new session for the user.
def auto_login
 Log the user in based on the presence of a "remember me" token.
def logout
 End the users session.
def request_reset_password
 Send an email to the user with unstructions on how to reset their password.
def reset_password
 Check the token, reset the password of the linked user, and email them a copy upon success.
def hash_password
 Hash the password.
def generate_random_password
 Returns a random password using the given characters.
def get_current_user
 Get the currently logged in user.

Detailed Description

Definition at line 29 of file auth.py.

Member Function Documentation

def wowf.lib.auth.Auth.auto_login ( )
static

Log the user in based on the presence of a "remember me" token.

Only works if the user chose to be remembered on last login, and a valid token exists.

Returns
Response headers or None

Definition at line 119 of file auth.py.

def wowf.lib.auth.Auth.check_invite (   token)
static

Check if the token is valid, and thus if the user is allowed to register.

Definition at line 54 of file auth.py.

def wowf.lib.auth.Auth.check_login (   email,
  password 
)
static

Check the email/password combo, and whether the user has privileges necessary to access the system.

Definition at line 80 of file auth.py.

def wowf.lib.auth.Auth.generate_random_password (   length = 8,
  chars = None 
)
static

Returns a random password using the given characters.

Parameters
charsA sequence of acceptable characters

Definition at line 207 of file auth.py.

def wowf.lib.auth.Auth.get_current_user ( )
static

Get the currently logged in user.

Returns
User instance or None

Definition at line 218 of file auth.py.

def wowf.lib.auth.Auth.hash_password (   password,
  check_password = None 
)
static

Hash the password.

Parameters
check_passwordCurrent password hash, used as salt

Definition at line 189 of file auth.py.

def wowf.lib.auth.Auth.login (   user,
  remember_me = False 
)
static

Start a new session for the user.

Performs no authentication on the user, so authenticate the user proior to logging them in.

Returns
Login response headers

Definition at line 97 of file auth.py.

def wowf.lib.auth.Auth.logout ( )
static

End the users session.

Delete login token if one is found.

    @return Response headers

Definition at line 134 of file auth.py.

def wowf.lib.auth.Auth.register (   user,
  login = True 
)
static

Provide the user with the minimum privileges necessary to access the system.

Parameters
loginWhether to return login headers

Definition at line 66 of file auth.py.

def wowf.lib.auth.Auth.request_reset_password (   email)
static

Send an email to the user with unstructions on how to reset their password.

Definition at line 152 of file auth.py.

def wowf.lib.auth.Auth.reset_password (   token)
static

Check the token, reset the password of the linked user, and email them a copy upon success.

Returns
True or False

Definition at line 168 of file auth.py.

def wowf.lib.auth.Auth.send_invite (   emails,
  user = None 
)
static

Send invitations to the given emails on behalf of the user, if given, or on behalf of the system.

Definition at line 37 of file auth.py.


The documentation for this class was generated from the following file: