|
@@ -3,6 +3,7 @@
|
|
|
## Files documented
|
|
|
|
|
|
* accounts_common.js
|
|
|
+* accounts_server.js
|
|
|
* accounts_rate_limit.js
|
|
|
* globals_client.js
|
|
|
* globals_server.js
|
|
@@ -136,7 +137,13 @@ Base class for `AccountsClient` / `AccountsServer`.
|
|
|
* `handler` {Function} A function that receives an options object (as passed as an argument to the `login` method) and returns one of: `undefined`, meaning don't handle; or a login method result object as described on `_loginUser`.
|
|
|
* `setExpireTokensInterval(accounts)`: starts a low-frequency (`EXPIRE_TOKENS_INTERVAL_MS` = 10 sec) task expiring tokens. Can be deactivated using `config({ loginExpirationInDays: null })`.
|
|
|
* `setupDefaultLoginHandlers()`: registers `defaultResumeLoginHandler()` as a login handler called `resume` using `registerLoginHandler()`.
|
|
|
-* `setupUsersCollection(users)` : configures the `users` collection obtained from the parent constructor, by applying `users.allow` to limite update rights to the document for the current user, and ensuring multiple MongoDB indexes.
|
|
|
+* `setupUsersCollection(users)` : configures the `users` collection obtained from the parent constructor, by applying `users.allow` to limite update rights to the document for the current user, and ensuring multiple MongoDB indexes:
|
|
|
+ * `username` : `{unique: 1, sparse: 1})`
|
|
|
+ * `emails.address`: `{ unique: 1, sparse: 1})`
|
|
|
+ * `services.resume.loginTokens.hashedToken`: `{unique: 1, sparse: 1})`
|
|
|
+ * `services.resume.loginTokens.token`: `{ unique: 1, sparse: 1})`
|
|
|
+ * `services.resume.haveLoginTokensToDelete`: `{ sparse: 1 })`
|
|
|
+ * `services.resume.loginTokens.when`: `{ sparse: 1 })`
|
|
|
* `updateOrCreateUserFromExternalService(serviceName, serviceData, options)`: Updates or creates a user after we authenticate with a 3rd party.
|
|
|
* `@param serviceName` {String} Service name (eg, twitter).
|
|
|
* `@param serviceData` {Object} Data to store in the user's record under services[serviceName]. Must include an "id" field which is a unique identifier for the user in the service. (Side note: there is a specific kludge for old Twitter ids).
|
|
@@ -154,6 +161,7 @@ Base class for `AccountsClient` / `AccountsServer`.
|
|
|
* `_attemptLogin(methodInvocation, methodName, methodArgs, result)`: After a login method has completed, call the login hooks: validation (which can turn allowed into disallowed), and login or loginFailure hooks. Note that `attemptLogin` is called for *all* login attempts, even ones which aren't successful (such as an invalid password, etc). If the login is allowed and isn't aborted by a validate login hook callback, log in the user. Use `_loginMethod()` instead.
|
|
|
* `_clearAllLoginTokens(userId)`: removes all login tokens on a user identified by `userId``.
|
|
|
* `_deleteSavedTokensForAllUsersOnStartup()`: on `Meteor.startup()`, immediately clean discovered saved tokens which applied to the previous instance of the application.
|
|
|
+* `_deleteSavedTokensForUser(userId, tokensToDelete)`: used by the delayed logout (CONNECTION_CLOSE_DELAY_MS) in obsolete method `logoutOtherClients()` and helper for `_deleteSavedTokensForAllUsersOnStartup()` to logout other clients.
|
|
|
* `_expireTokens(oldestValidDate, userId)`: Deletes expired tokens from the database and closes all open connections associated with these tokens. Exported for tests. Also, the arguments are only used by tests. oldestValidDate is simulate expiring tokens without waiting for them to actually expire. userId is used by tests to only expire tokens for the test user. **Side-effect** The observe on Meteor.users will take care of closing connections for expired tokens.
|
|
|
* `_failedLogin()`: invokes the `AccountsCommon.onLoginFailureHook` implementations.
|
|
|
* `_generateStampedLoginToken()`: generates a pseudo-random login token. As per docs: "Used by Meteor Accounts server and tests".
|