fix: Indexes _email_verify_token for email verification and _perishable_token password reset are not created automatically (#9893)

This commit is contained in:
Manuel
2025-11-01 13:52:23 +01:00
committed by GitHub
parent 00f8d4cda9
commit 62dd3c565a
6 changed files with 192 additions and 1 deletions

View File

@@ -687,6 +687,7 @@ export class MongoStorageAdapter implements StorageAdapter {
const defaultOptions: Object = { background: true, sparse: true };
const indexNameOptions: Object = indexName ? { name: indexName } : {};
const ttlOptions: Object = options.ttl !== undefined ? { expireAfterSeconds: options.ttl } : {};
const sparseOptions: Object = options.sparse !== undefined ? { sparse: options.sparse } : {};
const caseInsensitiveOptions: Object = caseInsensitive
? { collation: MongoCollection.caseInsensitiveCollation() }
: {};
@@ -695,6 +696,7 @@ export class MongoStorageAdapter implements StorageAdapter {
...caseInsensitiveOptions,
...indexNameOptions,
...ttlOptions,
...sparseOptions,
};
return this._adaptiveCollection(className)