elsa-workflows / elsa-workflows/elsa-core
[BUG] Should not allow duplicate username
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
## Description
Elsa.Identity username can duplicate when using Mongo DB
## Steps to Reproduce
- Starting a Elsa Server with identity APIs
- Call `POST /elsa/api/identity/users` multiple times with the same "name"
## Expected Behavior
Only the first API call should success and only one user should be created
## Actual Behavior
Multiple users with the same name are created
## Screenshots

## Environment
- **Elsa Package Version**: 3.1.3
- MongoDB: 4.4.29
## Additional Context
There should be a unique index on the Name field according to the code (https://github.com/elsa-workflows/elsa-core/blame/0816443dd60ed9efa264e90d1bf81db6884d5155/src/modules/Elsa.MongoDb/Modules/Identity/CreateIndices.cs), but for some reason I only have index on _id
Contributor guide
Assessment
This issue has not been assessed yet.