// Define a collection to hold our tasks. Tasks = new Mongo.Collection('tasks'); if (Meteor.isClient) { // This code is executed on the client only. Accounts.ui.config({ passwordSignupFields: "USERNAME_ONLY" }); Meteor.startup(function () { // Use this branch to render the component after the page is ready. ReactDOM.render(, document.getElementById('render-target')); }); } Meteor.methods({ addTask(text) { // Make sure user is logged before inserting a task. if (!Meteor.userId()) { throw new Meteor.error("not-authorized"); } Tasks.insert({ text: text, createdAt: new Date(), owner: Meteor.userId(), username: Meteor.user().username }); }, removeTask(taskId) { // Without checking user ? Meteor._debug("removing", taskId); Tasks.remove(taskId); }, setChecked(taskId, setChecked) { // Without checking user ? Meteor._debug("setCheck", taskId, setChecked); Tasks.update(taskId, { $set: { checked: setChecked }}); } });