Refactor code for otp

This commit is contained in:
Lakhan Samani
2023-07-13 11:39:22 +05:30
committed by catusax
parent 85ca0f09bf
commit 2f849b8f0c
33 changed files with 277 additions and 696 deletions

View File

@@ -125,15 +125,6 @@ func NewProvider() (*provider, error) {
},
}, options.CreateIndexes())
mongodb.CreateCollection(ctx, models.Collections.SMSVerificationRequest, options.CreateCollection())
smsCollection := mongodb.Collection(models.Collections.SMSVerificationRequest, options.Collection())
smsCollection.Indexes().CreateMany(ctx, []mongo.IndexModel{
{
Keys: bson.M{"phone_number": 1},
Options: options.Index().SetUnique(true).SetSparse(true),
},
}, options.CreateIndexes())
return &provider{
db: mongodb,
}, nil