Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor: change a user password WITHOUT logout?

Accounts.setPassword(userId, password);

Before Meteor v1.0.2, the user was not logout when calling this function.

Since v1.0.2, I quote from https://github.com/meteor/meteor/blob/devel/History.md, "Expire a user's password reset and login tokens in all circumstances when their password is changed".

I don't know the reason of this change,but the fact is that function above logout the user.

Is there a way, with v1.0.2, to change a user password without logout the user?

If not, how do I downgrade the package account-base so the behaviour is like before?

Thanks.

like image 781
user2409399 Avatar asked Dec 29 '14 17:12

user2409399


1 Answers

Accounts.setPassword(userId, password, options)

This method now supports options parameter that includes options.logout option which could be used to prevent the current user's logout.

like image 89
romaroma Avatar answered Oct 13 '22 09:10

romaroma