Auth

flitter-auth/deploy/controllers/Auth~ Auth

Controller for the auth and user functionality for Flitter-auth.

Constructor

new Auth()

Source:

Methods

create_auth_session(req, user)

Source:

Create an authenticated session.

Parameters:
Name Type Description
req Express/Request

the incoming Express request

user module:flitter-auth/deploy/models/User~User

the user for which a session should be created

dash_get(req, res)

Source:

Return the dash view. By default, this is pretty simple. It's designed to be replaced by your app.

Parameters:
Name Type Description
req Express/Request

the incoming Express request

res Express/Response

the corresponding Express response

destroy_auth_session(req)

Source:

Destroy the authenticated session.

Parameters:
Name Type Description
req Express/Request

the incoming Express request

login_get(req, res)

Source:

Serve the login view.

Parameters:
Name Type Description
req Express/Request

the incoming Express request

res Express/Response

the corresponding Express response

login_post(req, res)

Source:

Process a login request. If it is successful, create a user session and carry on.

Parameters:
Name Type Description
req Express/Request

the incoming Express request

res Express/Response

the corresponding Express response

logout(req, res)

Source:

Log the user out and destroy the authenticated session.

Parameters:
Name Type Description
req Express/Request

the incoming Express request

res Express/Response

the corresponding Express response

register_get(req, res)

Source:

Serve the registration page.

Parameters:
Name Type Description
req Express/Request

the incoming Express request

res Express/Response

the corresponding Express response

register_post(req, res)

Source:

Handle the registration and create a new user.

Parameters:
Name Type Description
req Express/Request

the incoming Express request

res Express/Response

the corresponding Express response