Monthly Archives: May 2014

Login with GitHub, twitter or facebook in Meteor

Meteor comes with an authentication system , which supports login with external services like

  • Facebook (accounts-facebook)
  • Github (accounts-github)
  • Google (accouts-google)
  • Meetup (accounts-meetup)
  • Twitter (accounts-twitter)
  • Weibo (accounts-weibo)

Meteor also provides forms for login, signup, password change, and password reset. To add the accounts and login controls in your application you need to add ‘account-ui’ package in your application

Now to add login support from one of the above listed external services, you just need to run this command

Now you will see, it will guide you through the required configuration. Similarly you can add other services also. To show the login buttons on our webpage we need to add

in our html file.

 

Meteor: Error: Not permitted. Untrusted code may only remove documents by ID

You’re also not allowed to call remove({}) from any client side code. If your app accumulates a bunch of crufty data while you’re prototyping, you might be sad about this. Client side code and the console fall under the concept “Untrusted Code” introduced by Meteor in 0.5.8.

“Trusted Code” includes the server code and method code. The key to the solution is that you can call methods defined on the Meteor server from the client using the Meteor.callmethod. Therefore, this will work in the console

Assuming you define removeAllPosts on the server like so

Source: http://gaslight.co/blog/how-to-remove-all-elements-from-a-meteor-collection