Closed mades5 closed 1 month ago
In your hook you can add a check that if there is no user to skip the auth check.
That's not possible, the user is already there. Just the rights are missing.
// if internal call from another service
if (context.params.provider === undefined) {
// skip checks
}
For adapter services all their service methods can be called without hooks by using their underscored (._get
, _.find
etc.) methods (see https://feathersjs.com/api/databases/common.html#methods-without-hooks)
Hi,
I added my own authentication strategy to feathers and have one problem with that. I authenticate my user in my strategy and try to get his rights from the database by accessing the service
const rights = await this.app?.service('rights').get(group);
This is working but the service always runs all the hooks from my service and there is a check if the user has the rights to access this service which he does not have at this point so I get an Unauthorized error. Is there a way to access a service and skipping hooks? I could not find anything about this in the documentation. Thanks