Accounts.setUsername

Server Accounts.setUsername(userId, newUsername) import { Accounts } from 'meteor/accounts-base' Source Change a user's username. Use this instead of updating the database directly. The operation will fail if there is an existing user with a username only differing in case. Arguments userId String The ID of the user to update. newUsername String A new username for the user.

accounts-ui

accounts-ui A turn-key user interface for Meteor Accounts. To add Accounts and a set of login controls to an application, add the accounts-ui package and at least one login provider package: accounts-password, accounts-facebook, accounts-github, accounts-google, accounts-twitter, or accounts-weibo. Then simply add the {{> loginButtons}} helper to an HTML file. This will place a login widget on the page. If there is only one provider configured and it is an external service, this will add a

Package.registerBuildPlugin

package.js Package.registerBuildPlugin([options]) Define a build plugin. A build plugin extends the build process for apps and packages that use this package. For example, the coffeescript package uses a build plugin to compile CoffeeScript source files into JavaScript. Options name String A cosmetic name, must be unique in the package. use String or Array of Strings Meteor packages that this plugin uses, independent of the packages specified in api.onUse. sources Array of Strin

DDPRateLimiter

DDPRateLimiter Customize rate limiting for methods and subscriptions. By default, DDPRateLimiter is configured with a single rule. This rule limits login attempts, new user creation, and password resets to 5 attempts every 10 seconds per connection. It can be removed by calling Accounts.removeDefaultRateLimit(). Server DDPRateLimiter.addRule(matcher, numRequests, timeInterval) import { DDPRateLimiter } from 'meteor/ddp-rate-limiter' Source Add a rule that matches against a stream of ev

Accounts.findUserByEmail

Server Accounts.findUserByEmail(email) import { Accounts } from 'meteor/accounts-base' Source Finds the user with the specified email. First tries to match email case sensitively; if that fails, it tries case insensitively; but if more than one user matches the case insensitive search, it returns null. Arguments email String The email address to look for

AccountsCommon#onLogin

Anywhere accountsClientOrServer.onLogin(func) Source Register a callback to be called after a login attempt succeeds. Arguments func Function The callback to be called when login is successful.

Package.onTest

Unit Tests Set up your tests with the Package.onTest handler, which has an interface that's parallel to that of the onUse handler. The tests will need to depend on the package that you have just created. For example, if your package is the email package, you have to call api.use('email') in order to test the package. If you used meteor create to set up your package, Meteor will create the required scaffolding in package.js, and you'll only need to add unit test code in the _test.js file that

Security

After reading this guide, you’ll know: The security surface area of a Meteor app. How to secure Meteor Methods, publications, and source code. Where to store secret keys in development and production. How to follow a security checklist when auditing your app. Introduction Securing a web application is all about understanding security domains and understanding the attack surface between these domains. In a Meteor app, things are pretty simple: Code that runs on the server can be trusted. Every

Collections and Schemas

After reading this guide, you’ll know: The different types of MongoDB collections in Meteor, and how to use them. How to define a schema for a collection to control its content. What to consider when defining your collection’s schema. How to enforce the schema when writing to a collection. How to carefully change the schema of your collection. How to deal with associations between records. MongoDB collections in Meteor At its core, a web application offers its users a view into, and a way to

customType.typeName

Anywhere customType.typeName() Source Return the tag used to identify this type. This must match the tag used to register this type with EJSON.addType.