setPassword = async (userId, newPassword) => {
  await Accounts.setPassword(userId, newPassword);
  // logout active connexions
  console.log('logging out');
  await logout(userId);
  // relog in and return new token
  const user = await Meteor.users.findOne({ _id: userId });
  if (!(user.emails && user.emails.length)) {
    throw new Error("User email not found, couldn't authenticate after password change");
  }
  const email = user.emails[0].address;
  console.log('email', email);
  return await authenticateWithPassword(email, newPassword);
}
Set password for a connected user
/!\ WILL LOGOUT AND LOG IN AGAIN THE USER in order to invalidate previous token