Accessing Username of Requestor
You can access information about the requesting user from within the doLookup, onDetails, and onMessage hooks.
// _request property on the `options` variable
{
_request: {
user: {
username: 'admin', //username of the requesting user
id: 5 // user if of the requesting user
}
}
}doLookup Example
function doLookup(entities, options, cb){
let username = options._request.user.username;
let userId = options._request.user.id;
// make use of `username` and/or `userId`
...onDetails Example
onMessage Example
Last updated