fix duplicate accounts
All checks were successful
Build and Push Docker Image / build_and_push (push) Successful in 2m2s
All checks were successful
Build and Push Docker Image / build_and_push (push) Successful in 2m2s
This commit is contained in:
@@ -72,15 +72,15 @@ func (s MongoDBStorage) LocalAuthentication(namespace string, username *string,
|
||||
account := &Account{}
|
||||
|
||||
if username != nil {
|
||||
if err := collection.FindOne(context.TODO(), bson.M{"namespace": namespace, "authentication.local.username": username}).Decode(account); err != nil {
|
||||
if err := collection.FindOne(context.TODO(), bson.M{"namespace": namespace, "authentication.local.username": *username}).Decode(account); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else if email != nil {
|
||||
if err := collection.FindOne(context.TODO(), bson.M{"namespace": namespace, "authentication.local.email": email}).Decode(account); err != nil {
|
||||
if err := collection.FindOne(context.TODO(), bson.M{"namespace": namespace, "authentication.local.email": *email}).Decode(account); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else if phone_number != nil {
|
||||
if err := collection.FindOne(context.TODO(), bson.M{"namespace": namespace, "authentication.local.phone_number": phone_number}).Decode(account); err != nil {
|
||||
if err := collection.FindOne(context.TODO(), bson.M{"namespace": namespace, "authentication.local.phone_number": *phone_number}).Decode(account); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user