elsa-workflows / elsa-workflows/elsa-core

[BUG] Should not allow duplicate username

Open
#5,725 2 comments 0 reactions 0 assignees View on GitHub
bug triaged
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
![image](https://github.com/elsa-workflows/elsa-core/assets/6951140/70b01cf1-0aca-41f7-9273-924f1addd3e5)

## 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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.