/user/key 🔑
Exports the apiKey method for the /api/user/key route.
- Source
Requires
- module:/user/acl
- module:jsonwebtoken
- module:/utils/processEnv
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:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
req | Object | HTTP request. | ||||||
res | Object | HTTP response. | ||||||
req.params | Object | Request parameter. Properties
|
- Source
Returns:
A promise that resolves with a response object from the request or an error.
- Type:
- Promise.<(Object|Error)>