meteor-accounts

Meteor takes time to know if there's a {{currentUser}} or not

戏子无情 提交于 2019-12-05 11:19:56
I've a few code that I want to run only when there's noUser and a few when there's a currentUser . All these are inside the navigation template. Like so... {{#if currentUser}} <li class="nav"><a href="{{pathFor 'create'}}">Post</a> </li> <li class="nav"><a>Ola, {{thisUser}}!</a> </li> <li class="nav"><a href="#" id="logout">Log Out</a> </li> {{/if}} {{#if noUser}} <li class="nav"><a href="{{pathFor 'signup'}}">Sign Up</a> </li> <li class="nav"><a href="{{pathFor 'login'}}">Login</a> </li> {{/if}} So the problem is that when there's a currentUser (i.e, I'm logged in) and I refresh the page, the

Can I use the same DB for multiple Meteor apps?

ⅰ亾dé卋堺 提交于 2019-12-03 13:52:04
Use case: the app I built on app.foo.com , and an instance of telescope on community.foo.com , on separate application servers. The only collection they'd share is users . I would give the same mongo url and oplog url to both apps, and make sure that other than users , collection names did not overlap between the two apps. Should this work fine? Any performance concerns? Akshat The problem with this is you have to share the collection names. If you use your databases you're also insured against Telescope suddenly using a collection name that your other app uses on a future version too. What

Using onResetPasswordLink, onEnrollmentLink, and onEmailVerificationLink methods properly in Meteor

情到浓时终转凉″ 提交于 2019-12-03 12:35:40
I was wondering if someone would be kind enough to provide a meteorpad or code example of using one of the methods listed above properly in Meteor (with iron:router). I'm struggling to understand how exactly these methods interact with my app, and it seems these methods are new enough that there isn't much good documentation on how to use them correctly. Thanks! http://docs.meteor.com/#/full/Accounts-onResetPasswordLink Ok, so I am going to post what I ended up learning and doing here so others can use it as a reference. I'll do my best to explain what is happening as well. As can be seen in

AWS SES with Meteor

限于喜欢 提交于 2019-12-02 02:42:41
I'm trying to out a Meteor package to interface with AWS SES called tarang:email-ses built by @Akshat. I'm on Meteor @1.* running on a AWS EC2 instance. When I a test run with the code below, no email was sent out. Meteor Code I've set up the AWS access key ID and secret access key and use it here: Meteor.startup(function () { Email.configSES({ AWSAccessKeyID: 'access-key', AWSSecretKey: 'secret-key' }); }); I've also verified my emails and domain. Here I make sure I'm sending from my verified sender SES address: Accounts.emailTemplates.from = 'Domain Name <support@domain-name.com>'; Then in a

Meteor - Why should I use this.userId over Meteor.userId() whenever possible?

时光总嘲笑我的痴心妄想 提交于 2019-12-01 21:12:22
问题 Judging from this comment by David Glasser in the GitHub issues: this.userId is the primary API and Meteor.userId() is syntactic sugar for users new to JavaScript who might not understand the details of successfully using this yet It seems like we should use this.userId whenever possible (such as inside a method function, where you can use both), and only use Meteor.userId() inside publish functions. If this assumption is correct, why ? (Referring to the relevant bits of the code would also

Meteor accounts-google Token Expires

折月煮酒 提交于 2019-12-01 21:09:19
问题 I have the Accounts-UI config setup to store an offline token for google thusly: if (Meteor.isClient) { Accounts.ui.config({ requestOfflineToken: { google: true }, forceApprovalPrompt: { google: true }, requestPermissions: { google: ["https://mail.google.com/"] } }); } However, tokens seem to expire. I assume I need to somehow use the refreshToken. I'm not sure how though with meteor. Any help would be lovely. Thanks! 回答1: I recommend using Google API Node JS client to refresh your access

Meteor accounts-twitter unable to get working

寵の児 提交于 2019-12-01 11:00:29
I've been having a go at Meteor. I want to use OAuth to authenticate users on my site as I do not want to implement the login features myself. At the moment my website is very simple. A counter, where you click a button the counter increases by one. The idea being when a user goes to another machine and logs in their count is persisted. I have followed the steps on meteor.com/accounts . meteor add accounts-twitter and meteor add accounts-ui Added {{> loginButtons}} to HTML. In Cloud9 terminal meteor --port $IP:$PORT Followed the on screen instructions on apps.twitter.com Set website abc

Meteor: How to assign different roles to users during sign up process

三世轮回 提交于 2019-11-30 19:41:12
I am using the meteor package ian:accounts-ui-bootstrap-3 for accounts and alanning:roles for assigning roles. On the sign up form I have two options one for Doctor and one for Advisor . I want to assign the selected option as a role to that user. Can someone let me know how to do this? I have just started learning meteor and don't know much about its flow. I can assign roles to a user if I create the user manually like this: var adminUser = Meteor.users.findOne({roles:{$in:["admin"]}}); if(!adminUser){ adminUser = Accounts.createUser({ email: "mohsin.rafi@mail.com", password: "admin", profile

How to partly update meteor.users.profile?

旧巷老猫 提交于 2019-11-30 13:20:46
问题 I have started a min app based on meteor boilerplate with the module accounts-ui. There is a collection created call users one of its elements is profile, this again has an element called "name" which gets the login name. With in this test app is an option to update a user profile. The data for the update comes from a Form submit. I have attached the event listener here Template.profile.events({ 'submit form': function(event) { event.preventDefault(); var data = SimpleForm.processForm(event

How to partly update meteor.users.profile?

笑着哭i 提交于 2019-11-30 06:47:39
I have started a min app based on meteor boilerplate with the module accounts-ui. There is a collection created call users one of its elements is profile, this again has an element called "name" which gets the login name. With in this test app is an option to update a user profile. The data for the update comes from a Form submit. I have attached the event listener here Template.profile.events({ 'submit form': function(event) { event.preventDefault(); var data = SimpleForm.processForm(event.target); Meteor.users.update(Meteor.userId(), {$set: {profile: data}}); } }); So data has everything