You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to run a global before hook, for example setField({ from: 'params.user.id', as: 'data.createdById' }), after the service level before hooks have run?
The services should in this case manage authentication and decide which authentication strategies that are allowed so the authenticate hook cannot be global and the global hook needs to be run after authentication.
I'm open for any workarounds, but I'd rather not add the createdById hook to all existing and new services.
What about app.hooks? They are called before and/or after each all service hooks.
That's the problem, they are called before the service level hooks in before events. My question is if it's possible to have them run after the service level before hooks (authentication hooks).
Activity
asamolion commentedon Apr 5, 2020
What about app.hooks? They are called before and/or after each all service hooks.
rlunden commentedon Apr 6, 2020
That's the problem, they are called before the service level hooks in before events. My question is if it's possible to have them run after the service level before hooks (authentication hooks).
bertho-zero commentedon Apr 7, 2020
I advise you to keep only one hook declaration for a service. And possibly add hooks for the integrated service into the app.
I am not sure I understood the problem but it is possible to call a hook inside another and to do it conditionally with a param, for example.