Pass data/params to Post Registration hook via Lock API

I would like to implicitly assign a role whenever a user registers via the lock API, however I am struggling to pass any sort of data/params across to the Post Registration hook - is this even possible?

I tried the following, but params seem to be limited to rules:

 lock.show({
    auth: {
      params: { role: "provider" }
    }
});

If I can access the params within the hook body I can then set the role using the management API. I know this is possible using a rule but I would prefer to handle this in the Post Reg hook.

Any advice will be greatly appreciated :+1:

Thanks

A user registration through Lock would translate into an API call into the signup endpoint. Can you clarify how may possible ways you have in your system for that signup endpoint to be called? The reason to ask is that you may be able to differentiate between them through other means and still be able to assign a default role only to the subset of users you need.

1 Like

Hey there!

As this topic is related to Rules - Hooks - Actions and Rules & Hooks are being deprecated soon I’m excited to let you know about our next Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!

Learn more here!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.