diff --git a/storage/mongodb.go b/storage/mongodb.go index 50bb9d8..5762d91 100755 --- a/storage/mongodb.go +++ b/storage/mongodb.go @@ -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 {