feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
14.97k stars 744 forks source link

docs: Update anonymous hook to support around hooks #3379

Closed howlettt closed 6 months ago

howlettt commented 6 months ago

The current anonymous hook in the documentation doesn't work with around hooks since it doesn't have the next param https://feathersjs.com/cookbook/authentication/anonymous.html

return async (context: HookContext) => {

This PR adds a optional next param so it can be used in both before & around hooks, making it consistent with the authenticate hook https://feathersjs.com/api/authentication/hook

It can be used as a before or around hook.
daffl commented 6 months ago

Thank you!