Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upProblems with Accounts.config.defaultFieldsSelector. #11158
Comments
|
Hi, please assign this issue to me |
On Meteor 1.11, adding the
defaultFieldsSelectorconfig ofAccounts.confighas two problems:Accounts.forgotPasswordalways return an error of "No such email" if thedefaultFieldsSelectordoesn't have email as a default field. It seems to be missing an internal fields selector on the internal query to the users collection.Accounts.onLogincallback has no way of configuring the fields returned in the user that's given in the callback parameter.Expected behavior:
forgotPasswordshould work without errors when theAccounts.config.defaultFieldsSelectordoesn't have the email as a default field. It seems to be missing a selector in it's internal query to the users collection.Accounts.onLoginshould allow to configure a selector for the user object that's given inside the callback parameter.To reproduce the problem:
Accounts.config({defaultFieldsSelector: {_id: 1}});somewhere on the project (both client and server).Accounts.onLogin((loginData) => {console.log(loginData.user)});to see that the user always return only the_id, but there's no way to make it return the username or email for only that callback unless adding those values to thedefaultFieldsSelector.