Class: UserController

lib/controllers/user-controller~UserController()

new UserController()

Create a UserController.
Source:

Methods

(async, static) findUserAndSetResetPasswordToken(req, res, next, token) → {module:lib/models/user}

Set the token of the specified User resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object.
next function The next middleware function.
token string The generated reset password token.
Source:
Returns:
The modified User resource.
Type
module:lib/models/user

(async, static) generateResetPasswordConfirmationEmail(req, res, next, user)

Create and send the reset password confirmation email to the owner of the specified User resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object.
next function The next middleware function.
user module:lib/models/user The User resource that had its password reset.
Source:

(async, static) generateResetPasswordEmail(req, res, next, token, user)

Create and send reset password email for specified User resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object.
next function The next middleware function.
token string The generated reset password token.
user module:lib/models/user The specified User resource.
Source:

(async, static) generateResetPasswordToken(req, res, next) → {string}

Create token for resetting passord.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object.
next function The next middleware function.
Source:
Returns:
The generated reset password token.
Type
string

(async, static) resetPassword(req, res, next) → {module:lib/models/user}

Reset the password of the specified User resource and login the User.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object.
next function The next middleware function.
Source:
Returns:
The User resource that had its password reset.
Type
module:lib/models/user

(async, static) userCreatePost(req, res)

Create a new User resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(async, static) userEditGet(req, res)

Show to the form for editing the specified User resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(async, static) userFollowGet(req, res)

Follow the specified User resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(async, static) userForgotGet(req, res)

Show the forgot password form for the specified User resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(async, static) userForgotPost(req, res, next)

Send password reset request for specified user resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object.
next function The next middleware function.
Source:

(static) userIndexGet(req, res)

Display a listing of the Landing page.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(static) userLoginGet(req, res)

Show to the form for logging in the specified User resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(static) userLoginPost(req, res, next)

Login the specified User resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object.
next function The next middleware function.
Source:

(static) userLogoutPost(req, res)

Logout the specified User resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(static) userNewGet(req, res)

Show the form for creating a new User resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(async, static) userResetGet(req, res, next)

Show the reset password form for the specified User resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object.
next function The next middleware function.
Source:

(async, static) userResetPost(req, res, next)

Reset password for specified User resource, and send confirmation email to its owner.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object.
next function The next middleware function.
Source:

(async, static) userShowGet(req, res)

Display the specified User resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(async, static) userUpdatePut(req, res)

Update the specified User resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source: