More API changes on auth

94 views
Skip to first unread message

Nick Martin

unread,
Sep 27, 2012, 11:11:59 PM9/27/12
to meteo...@googlegroups.com
Hey all,

Another batch of API changes on auth!

The only breaking change this time is eliminating the function and DDP method 'enrollAccount'. Use 'resetPassword' instead. The old method did the same thing as resetPassword, but used a separate token. Now there is just one password reset with token path.

As we've mentioned before, we're interested in people building alternatives for accounts-ui with different structures and flows. But now, if you want to make a login UI with the same structure as accounts-ui, but different CSS, we've added the 'accounts-ui-unstyled' package. I'm not sure how easy it will be to restyle the accounts-ui html, but people were asking for this so lets give it a whirl! We'll gladly entertain pull requests for more divs, new class names, etc, that make it easier to style.


Some other non-breaking improvements:

- Meteor.user() now works in methods on the server. This should simply the common pattern of Meteor.users.findOne(this.userId()).

- Meteor.userId() in addition to Meteor.user().

- Add Meteor.setPassword(userId, newPassword) on the server.

- Meteor.createUser on the server now allows you to specify a password.

- Fix #353, a nasty bug in the livedata method wait logic that could result data sync breaking. Thanks, @thedracle and @glasser!


Cheers!
-- Nick

steeve

unread,
Sep 30, 2012, 3:13:03 PM9/30/12
to meteo...@googlegroups.com
Nick;

Per 

[Server] Meteor.createUser(options, extra) - Creates a user and sends that user an email with a link to choose their initial password and complete their account enrollment

I really think you should consider the option of server side create without the email to the user and the activation link as a configurable option.  For example, the popular CMS Joomla (with or without Community Builder or jomSocial) allows these options on user initiated sign up or admin created (server side essentially).

A.  User sign up with or without activation email.

B.  Admin (server side) creation of user with or without activation email.

Granted there will be sites that want email with a link and the whole follow on but there will be sites that don't want it and may not need it.  Examples include company intranets and other closed systems that either do not have user initiated sign up, or user initiated sign up is from within an organizations confines and firewalls or all users are being created by the company administrator for "known and pre-verified" users (employees and such).

Thanks
Steeve

Nick Martin

unread,
Sep 30, 2012, 3:22:55 PM9/30/12
to meteo...@googlegroups.com
Hi Steeve,

If I understand what you are asking, I think that is already on the auth branch. Meteor.createUser on the server now accepts users with or without email and with or without password. It will send an 'enrollment' email only if the user has an email, but does not have a password.

Cheers,
-- Nick

--
You received this message because you are subscribed to the Google Groups "meteor-core" group.
To view this discussion on the web visit https://groups.google.com/d/msg/meteor-core/-/NpLXWbWV5rwJ.
To post to this group, send email to meteo...@googlegroups.com.
To unsubscribe from this group, send email to meteor-core...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/meteor-core?hl=en.

steeve

unread,
Sep 30, 2012, 3:26:22 PM9/30/12
to meteo...@googlegroups.com
Awesome.  Good to know.  I am going to test it out today then and if it works replace the old 'long' way that I was creating users.

Thanks
Steeve

steeve

unread,
Oct 1, 2012, 8:56:02 PM10/1/12
to meteo...@googlegroups.com
Nick;

Is there a way for

[Server] Meteor.createUser(options, extra) - Creates a user and sends that user an email with a link to choose their initial password and complete their account enrollment

  • options a hash containing: emailusername, and/or password
  • extra: extra fields for the user object (eg name, etc).

To provide the _id?

Use Case
1.  Create user server side.
2.  Need to update other collections with that _id.  Like Groups.users = [_id1, _id2, _id3]

Right now I am still using 

Meteor.users.insert server side instead.

Thanks
Steeve

Nick Martin

unread,
Oct 1, 2012, 9:30:54 PM10/1/12
to meteo...@googlegroups.com
It's not documented to return the id on the server, but it looks like that is what the code does. I'll update the docs. =)

-- Nick

To view this discussion on the web visit https://groups.google.com/d/msg/meteor-core/-/5IS6w6RnQA8J.
Reply all
Reply to author
Forward
0 new messages