Closed clarkritchie closed 8 years ago
Strange !!! (Niether creating user, nor throwing an exception.)
It may be possible that one of your fields may be empty. Not sure though.
Check to see if this is happening when you allow Random.id()
to generate a password.
If I get time, I'll test this at my end.
I've never seen Random.id()
return blank but happy to add some checks around that. I probably can't release any code until next week due to the holiday...
The logic there was to set an initial password, force them to verify their phone, and then make them set their own password.
This is probably unrelated, but I've seen Meteor.userId()
sometimes be null
server side when it absolutely, positively should not be null
. This is pretty rare but enough to notice. I haven't gone through your code, any chance you're relying on that?
OK I think there are/were two issues.
Client side behavior in my app (users pressing enter on their phone vs. using the submit button) was sending incomplete data to my createUser
method, which in turn called your createUserWithPhone
with incomplete data. I fixed that with stronger client side data validation on my end.
I do think that createUserWithPhone
was definitely not throwing an exception when it received incomplete data. So perhaps stronger arg checking on your end? I don't know, sort of swamped and can't test much right now.
Thanks for the package! Over 2k verified users in our app.
We're using
Accounts.createUserWithPhone
server-side so we can wrap it with necessary permission checks, add the user to necessary roles post-create, and so on.Simplified a little, our Meteor method pretty much boils down to this:
The documentation says no callback on the server.
For grins I wrapped
createUserWithPhone
in a try/catch and logged out the_id
.I am seeing a lot of
undefined
values.Any thoughts?