Forms

flitter-auth/controllers/Forms~ Forms

Controller for displaying and processing registrations/logins/etc.


Constructor

new Forms()

Extends

Members

(static) services

Specify the services required by this controller. The configs service is loaded automatically.

(private) _di_allow_defer :boolean

If true, the injector will defer the class if the class requests any services that the container is missing. These services are filled in later and added to the prototype and any instances. True by default.

Type:
  • boolean

(private) _di_deferred_instances :Array.<module:flitter-di/src/Injectable~Injectable>

Collection of instances of this class that need to have the deferred service instances injected into them when the deferred services are finally provided.

(private) _di_deferred_services :Array.<string>

List of services that were deferred and not provided at the time of injection.

Type:
  • Array.<string>

Methods

(async) login_provider_authenticate_user(req, res, next) → {Promise.<*>}

Middleware that attempts to authenticate a user. If the authentication via the auth provider succeeds, the auth session is created and the next handler in the stack is called. Otherwise, the login view is returned with the error object.

Parameters:
Name Type Description
req express/request

the request

res express/response

the response

next function

the next function in the stack

Returns:
Type
Promise.<*>

(async) login_provider_get(req, res, next) → {Promise.<*>}

Handle a GET request to the login page. Usually displays the login form. Calls the 'handle_login_get' method on the auth provider.

Parameters:
Name Type Description
req express/request

the request

res express/response

the response

next function

the next function in the stack

Returns:
Type
Promise.<*>

(async) login_provider_present_success(req, res, next) → {Promise.<*>}

Sends the response for a successful login authentication.

Parameters:
Name Type Description
req express/request

the request

res express/response

the response

next function

the next function in the stack

Returns:
Type
Promise.<*>

(async) logout_provider_clean_session(req, res, next) → {Promise.<*>}

Cleans the auth session on a logout request. This is a middleware that shouldn't return a response if everything is successful.

Parameters:
Name Type Description
req express/request

the request

res express/response

the response

next function

the next function in the stack

Returns:
Type
Promise.<*>

(async) logout_provider_present_success(req, res, next) → {Promise.<*>}

Returns the response signifying a successful logout.

Parameters:
Name Type Description
req express/request

the request

res express/response

the response

next function

the next function in the stack

Returns:
Type
Promise.<*>

(async) registration_provider_create_user(req, res, next) → {Promise.<*>}

Do the action to create a new user with the request body. This is a middleware that should not send a response.

Parameters:
Name Type Description
req express/request

the request

res express/response

the response

next function

the next function in the stack

Returns:
Type
Promise.<*>

(async) registration_provider_get(req, res, next) → {Promise.<*>}

Show the registration page specific to a provider.

Parameters:
Name Type Description
req express/request

the incoming request

res express/response

the outgoing response

next function

callback handler for errors, etc.

Returns:
Type
Promise.<*>

(async) registration_provider_present_user_created(req, res, next) → {Promise.<*>}

Presents a view showing that the user has registered successfully.

Parameters:
Name Type Description
req express/request

the request

res express/response

the response

next function

the next function in the stack

Returns:
Type
Promise.<*>