fix: tests for otp refactor
This commit is contained in:
@@ -77,7 +77,7 @@ func (p *provider) GetOTPByPhoneNumber(ctx context.Context, phoneNumber string)
|
||||
var otps []models.OTP
|
||||
var otp models.OTP
|
||||
collection := p.db.Table(models.Collections.OTP)
|
||||
err := collection.Scan().Index("phone_number").Filter("'phone_number' = ?", phoneNumber).Limit(1).AllWithContext(ctx, &otps)
|
||||
err := collection.Scan().Filter("'phone_number' = ?", phoneNumber).Limit(1).AllWithContext(ctx, &otps)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@@ -31,11 +31,11 @@ func NewProvider() (*provider, error) {
|
||||
if awsRegion != "" {
|
||||
config.Region = aws.String(awsRegion)
|
||||
}
|
||||
|
||||
// custom awsAccessKeyID, awsSecretAccessKey took first priority, if not then fetch config from aws credentials
|
||||
if awsAccessKeyID != "" && awsSecretAccessKey != "" {
|
||||
config.Credentials = credentials.NewStaticCredentials(awsAccessKeyID, awsSecretAccessKey, "")
|
||||
} else if dbURL != "" {
|
||||
log.Debug("Tring to use database url for dynamodb")
|
||||
// static config in case of testing or local-setup
|
||||
config.Credentials = credentials.NewStaticCredentials("key", "key", "")
|
||||
config.Endpoint = aws.String(dbURL)
|
||||
|
Reference in New Issue
Block a user