Singleton models; do not require user password

This commit is contained in:
Sebastian Rindom committed 2020-04-03 12:53:52 +02:00
1 parent 8ab9b823b9
commit c82c9f3733
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -19,7 +19,7 @@ export default ({ container }) => {
const loaded = require(fn).default const loaded = require(fn).default
const name = formatRegistrationName(fn) const name = formatRegistrationName(fn)
container.register({ container.register({
[name]: asFunction(cradle => new loaded(cradle)), [name]: asFunction(cradle => new loaded(cradle)).singleton(),
}) })
}) })
@@ -37,7 +37,7 @@ export default ({ container }) => {
const name = formatRegistrationName(fn) const name = formatRegistrationName(fn)
container.register({ container.register({
[name]: asFunction(cradle => new loaded(cradle)), [name]: asFunction(cradle => new loaded(cradle)).singleton(),
}) })
}) })
} }
+1 -1
View File
@@ -9,7 +9,7 @@ class UserModel extends BaseModel {
static modelName = "User" static modelName = "User"
static schema = { static schema = {
email: { type: String, required: true }, email: { type: String, required: true },
passwordHash: { type: String, required: true }, passwordHash: { type: String },
metadata: { type: mongoose.Schema.Types.Mixed, default: {} }, metadata: { type: mongoose.Schema.Types.Mixed, default: {} },
} }
} }