Singleton models; do not require user password
This commit is contained in:
1 parent
8ab9b823b9
commit
c82c9f3733
2 files changed
+3
-3
No files matched your search
@@ -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(),
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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: {} },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user