If you add a member twice in the back office with the same username and same email. Even though Umbraco throws and error about a duplicate. - If you check the list of members you will find that the member exists twice.
This is the same if you create a member programmatically. Umbraco throws an exception, but the member still ends up in the db... is this a bug? or am I missing something?
I am going to change my code to look for the member first before trying to create a new one. - if this is a bug this is a pretty major one.
I have tried to replicate your issue in the back office but umbraco does not save the second member if I try to add one with the same username and email. I will check what happens in code, but the back office definitely doesn't allow me to save it.
I will create a quick video, becuase it definitaely happens in the back office too. - It will throw an exception... but then if you go and look at the members list... you will find a duplicate member.
In my code, I just check that the username is not already registered and return a 'username is already registered' error instead of creating a new member
var member = Members.GetByUsername(model.username);
if(member != null){
error = "A member is already registerd with this username";
return false;
}
Umbraco 8 Bug? Duplicate Members
Hi guys,
I think I have found a bug in Umbraco (V8.10.1)
If you add a member twice in the back office with the same username and same email. Even though Umbraco throws and error about a duplicate. - If you check the list of members you will find that the member exists twice.
This is the same if you create a member programmatically. Umbraco throws an exception, but the member still ends up in the db... is this a bug? or am I missing something?
I am going to change my code to look for the member first before trying to create a new one. - if this is a bug this is a pretty major one.
I have tried to replicate your issue in the back office but umbraco does not save the second member if I try to add one with the same username and email. I will check what happens in code, but the back office definitely doesn't allow me to save it.
not able to replicate in code either, it just doesn't save the second user.
ignore previous reply, I forgot my code did a check :)
I can confirm that in code it does allow me to create a member with a duplicate username and email, just not from the back office.
I will create a quick video, becuase it definitaely happens in the back office too. - It will throw an exception... but then if you go and look at the members list... you will find a duplicate member.
I tested that in both 8.10.1 and 8.11.1 and it doesn't save the member for me in the back office, it just refuses to save as expected.
For anyone else interested in this issue, there is a ticket on Github. It does not look like it will be addressed.
In my code, I just check that the username is not already registered and return a 'username is already registered' error instead of creating a new member
is working on a reply...