Controller module providing logic for managing email confirmation tokens
Example
import { confirmEmailTokens as confirmEmailTokensController } from '/src/controllers';
Methods
(async, static) createOne(request, response, next)
Create and email a token for confirming a users email address.
Parameters:
| Name | Type | Description |
|---|---|---|
request |
Object | HTTP request object |
response |
Object | HTTP response object callback |
next |
Object | Call the next route handler |
Throws:
-
- Will throw an error if no request.body is present
-
- Will throw an error if no request.body.email is present
Returns:
- A http response body
(async, static) destroyExpired(request, response, next)
Will destroy confirm email tokens that are past now.
Parameters:
| Name | Type | Description |
|---|---|---|
request |
Object | HTTP request object. |
response |
Object | HTTP response object callback. |
next |
Object | Next route callback handler. |
Throws:
Will throw an error if no destroyedCount created.
Returns:
Will return a http response body.
(async, static) destroyOne(request, response, next) → {Object}
Destroy confirm email token record with primary key id
Parameters:
| Name | Type | Description |
|---|---|---|
request |
Object | HTTP request object. |
response |
Object | HTTP response object callback. |
next |
Object | Next route callback handler. |
Throws:
-
- Will throw an error if no request.params are provided.
-
- Will throw an error if no primary key id is provided in the request.params.
-
- Will throw an error if no destroyedCount is created.
Returns:
Returns a http response object
- Type
- Object
(async, static) readAll(request, response, next)
Read all confirm email token records.
Parameters:
| Name | Type | Description |
|---|---|---|
request |
Object | HTTP request object. |
response |
Object | HTTP response object callback. |
next |
Object | Call the next route handler. |
Throws:
- Will throw an error if no foundResetTokens is created.
Returns:
- Will return a http response body.
(async, static) readOne(request, response, next)
Read all confirm email token records
Parameters:
| Name | Type | Description |
|---|---|---|
request |
Object | HTTP request object |
response |
Object | HTTP response object callback |
next |
Object | Call the next route handler |
Throws:
-
Will throw an error if no request.params are present.
-
Will throw an error if no request.params.id is present.
-
Will throw an error if foundResetToken is not created.
Returns:
- Will return a http response body.
(async, static) updateOne(request, response, next)
Update a request token record.
Parameters:
| Name | Type | Description |
|---|---|---|
request |
Object | HTTP request object. |
response |
Object | HTTP response object callback. |
next |
Object | Call the next route callback handler. |
Throws:
-
- Will throw an error if no request.params is passed in.
-
- Will throw an error if no request.params.id is passed in.
-
- Will throw an error if no request.body is passed in.
-
- Will throw an error if no updatedResetToken is created.
Returns:
- Will return a http response body