-
-
Notifications
You must be signed in to change notification settings - Fork 140
Open
Description
The property userCollectionName
is not part of the Mongo
options in the package @accounts/mongo
.
I'm using:
"@accounts/mongo": "^0.34.0",
"@accounts/password": "^0.32.0",
I even get the error on TS end, that userCollectionName
is not part of Mongo
object:
Although, the above code runs perfectly, I get that error from TS.
I think, in case you don't want to expose userCollectionName
in Mongo
object of @accounts/mongo
, the precedence for it should be:
1.- userCollectionName
in options
param.
2.- collectionName
in options
param.
3.- userCollectionName
in defaultOptions
.
Here's the current code:
accounts/packages/database-mongo-password/src/mongo-password.ts
Lines 81 to 85 in ff983b8
this.options = { | |
...defaultOptions, | |
...options, | |
timestamps: { ...defaultOptions.timestamps, ...options.timestamps }, | |
}; |
My suggestions would be something like:
constructor(options: MongoServicePasswordOptions) {
this.options = {
...defaultOptions,
userCollectionName: options.userCollectionName ||
options.collectionName || defaultOptions.userCollectionName,
...options,
timestamps: { ...defaultOptions.timestamps, ...options.timestamps },
};
Thanks in advance.
Metadata
Metadata
Assignees
Labels
No labels