Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/accounts-base/accounts_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
* - connection {Object} Optional DDP connection to reuse.
* - ddpUrl {String} Optional URL for creating a new DDP connection.
*/

import {ModelUsers} from './model_users';

export class AccountsCommon {
constructor(options) {
// Currently this is read directly by packages like accounts-password
Expand All @@ -20,10 +23,15 @@ export class AccountsCommon {

// There is an allow call in accounts_server.js that restricts writes to
// this collection.

/*
this.users = new Mongo.Collection("users", {
_preventAutopublish: true,
connection: this.connection
});
*/

this.users = new ModelUsers(this.connection);

// Callback exceptions are printed with Meteor._debug and ignored.
this._onLoginHook = new Hook({
Expand Down Expand Up @@ -51,7 +59,7 @@ export class AccountsCommon {
*/
user() {
var userId = this.userId();
return userId ? this.users.findOne(userId) : null;
return userId ? this.users.findSingle(userId) : null;
}

// Set up config for the accounts system. Call this on both the client
Expand Down
Loading