I wonder how to change user profile information in Meteor. I created an application using the accounts-base package, so I can quickly manage all related stuff with user accounts. Which is really great.
In official docs it says:
profile: an Object which (by default) the user can create and update with any data.
But how could I let the user to change it?
Regarding the same topic, using the {{loginButtons}}
tag by default I get the following image when the user has logged in:
Is there any possibility to add Change profile
, Change email
or something similar?
Thanks
For the moment accounts-ui
doesn't have a change profile button built in, you have to make it manually.
For instance if you do
Meteor.users.update({_id:Meteor.user()._id}, {$set:{"profile.name":"Carlos"}})
You could change the screen in accounts-ui
above you have to show a name instead of the email you would click to display the dialog above.
The email is a little bit tricker, you have to do this from the server since (in a meteor.methods/call perhaps) you can't modify the email stuff from the client, I would suggest adding a new email and having it verified instead of changing the existing email (since its also their login). Or having it verified first then changing it so as not to change someones email to something where they can't recover their password.
Meteor.users.update({_id:Meteor.user()._id}, {$addToSet:{"emails":{address:"[email protected]","verified":false}}});
Or if you want users to have one email they can change:
Meteor.users.update({_id:Meteor.user()._id}, {$set:{"emails":[{address:"[email protected]"}]});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With