lib/authentication.js

Handle (pseudo-)authentication
Author:
Source:

Methods

(inner) getUser(req) → {Object}

Get the user that is currently authenticated (if any)
Source:
Parameters:
Name Type Description
req Object Express request
Returns:
Type:
Object
user properties (dictionary) of the user, if any; undefined otherwise

(inner) isKnownUser(req) → {Boolean}

Check if the user is authenticated
Source:
Parameters:
Name Type Description
req Object Express request
Returns:
Type:
Boolean
whether the user is authenticated

(inner) logOut(req)

De-authenticate a user (log them out)
Source:
Parameters:
Name Type Description
req Object Express request

(inner) setUp(app)

Set up authentication
Source:
Parameters:
Name Type Description
app Object the Express application

(inner) setUser(req, user)

Authenticate a user
Source:
Parameters:
Name Type Description
req Object Express request
user Object user properties (a dictionary)