fixed bugs

This commit is contained in:
2025-03-19 19:56:58 +02:00
parent 1488d7db16
commit 32d64f3637
14 changed files with 173 additions and 98 deletions

View File

@@ -98,6 +98,14 @@ func (self *UserPassAuthenticationDbHandler) CreateUser(
return err
}
func (self *UserPassAuthenticationDbHandler) CountUsers(ctx context.Context) (uint, error) {
count, err := self.collection.CountDocuments(ctx, bson.M{})
if err != nil {
return 0, err
}
return uint(count), nil
}
func (self *UserPassAuthenticationDbHandler) RemoveUser(ctx context.Context, username string) error {
_, err := self.collection.DeleteOne(
ctx,