/user/key 🔑
Exports the apiKey method for the /api/user/key route.
- Source
- Source
Requires
- module:/user/acl
- module:jsonwebtoken
Methods
(inner) apiKey(req, res)
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.
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
req | Object | HTTP request. | ||||||
res | Object | HTTP response. | ||||||
req.params | Object | Request parameter. Properties
|
- Source
(inner) userToken(req, res)
The /api/user/token
endpoint requests a jsonwebtoken for the user object.
The encoded user token expires in 8hours and does not carry admin rights.
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
req | Object | HTTP request. | ||||||
res | Object | HTTP response. | ||||||
req.params | Object | Request parameter. Properties
|
- Source