/user/key 🔑

Exports the apiKey method for the /api/user/key route.

Requires

Methods

(inner) apiKey(req, res) → {Promise.<(Object|Error)>}

The /api/user/key endpoint requests a new API key for the requesting user.

The requesting user must have an ACL record with the api field not being null.

The newly generated API key does not expire but will overwrite any existing API key for the user in the ACL record.

An API key can be revoked by setting the api field in the ACL record to null.

Parameters:
NameTypeDescription
reqObject

HTTP request.

resObject

HTTP response.

req.paramsObject

Request parameter.

Properties
NameTypeDescription
userObject

Requesting user.

Returns:

A promise that resolves with a response object from the request or an error.

Type: 
Promise.<(Object|Error)>