queryWithCurrentUser Generating the following error There is no current user to associate.
abalad opened this issue · comments
Maicon Wagner commented
{
"name": "GeneralError",
"message": "There is no current user to associate.",
"code": 500,
"className": "general-error",
"data": {},
"errors": {}
}
const { authenticate } = require('@feathersjs/authentication').hooks;
const hooks = require('feathers-authentication-hooks');
module.exports = {
before: {
all: [],
find: [
function(context){ console.log(context) },
hooks.queryWithCurrentUser({ idField: 'id', as: 'usuario_id' })
],
get: [],
create: [],
update: [],
patch: [],
remove: []
},
after: {
all: [],
find: [],
get: [],
create: [],
update: [],
patch: [],
remove: []
},
error: {
all: [],
find: [],
get: [],
create: [],
update: [],
patch: [],
remove: []
}
};
David Luecke commented
There has to be a params.user
, which is usually added by the authenticate()
hook.
Maicon Wagner commented
I've created an implementation suggestion #49