[SOLVED] Is there a way to register a user without password initially?


#1

Hi all,

I have search the doc, seems possible. But when I call the registerUser method with only username and email, it failed to let me pass through. Any idea?


#2

You create user without password only on server. So you can use method that works on server.

Check out doc: Accounts.createUser


#3

Yup, I was calling the createUser from server side. But I still got the error required me to input password. emmm… what am i missing.


#4

Can you post code snippet and server log?


#5

Server side:

Meteor.methods({
	// call from client
	retailerRegister: function() {
		return Accounts.createUser({
			username: 'hello',
			email: 'hellow@gmail.com'
		});
	}
});

Error (something like this):

Exception while simulating the effect of invoking 'retailerRegister' Error: Must set options.password {stack: (...), message: "Must set options.password"}message: "Must set options.password"stack: (...)get stack: function () { [native code] }set stack: function () { [native code] }__proto__: d Error: Must set

#6

Does it log from web console?

Are you really sure your method only works on server? Where is it located? Make sure whether it is on /server ?


#7

You are right! I was putting it in /collections folder. I will test it only on server. Thanks. :smiley: I will mark this as solved. Thanks.