feathersjs-ecosystem / feathers-authentication-management

Adds sign up verification, forgotten password reset, and other capabilities to local feathers-authentication
https://feathers-a-m.netlify.app/
MIT License
246 stars 98 forks source link

how to pass hook data to the notifier #82

Closed DelfsEngineering closed 6 years ago

DelfsEngineering commented 6 years ago

I have a unique situation where I am managing authentication for several subdomains from a single codebase. In my notifier.js code I call an external API that handles the transactional communications.

I want to be able to pass this external service the subdomain and / or anything else I inject with a hook.

Is there a way I can get access to the hook or pass in the subdomain data to the notifier?

eddyystop commented 6 years ago

The notifier is called with

notifier(options.notifier, 'resendVerifySignup', user, notifierOptions)

The notifierOptions is passed from the call to the service

authManagement.create({ notifierOptions: ... }

That would be the way to pass custom values to the notifier.

DelfsEngineering commented 6 years ago

Brilliant, that solves that. Cheers