I'm using the http://useraccounts.meteor.com/ package for user auth templates and functionality. However, I have two different user types that require different signup forms. I'm using:
AccountsTemplates.addField({ });
to customize Form #1 and was hoping to use another call like this for Form #2 but when I do so, I get:
Error: AccountsTemplates.addField should strictly be called before AccountsTemplates.init!
I could of course make a custom form for one of them but I would like to stick to using the package as it keeps things tidier.
How could I create two separate instances of the signup form??
@PhilippSpo is right, at the moment there is no easy solution to this use case.
There's a bit of a discussion here proposing a workaround, even though it's not a suggested practice.
Actaully you could make it work as long as you don't want to have different required
fileds in the two forms, but there's no way to get it done in case you'd like to have different required fields for the different user types.
The problem arises because one of the selling point of useraccounts
packages is the strong server-side validation of the new user profile: letting users sign up with different lists of required fields might open doors to trick the sign up process...