Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Error with email email address already in use :(

Open drickerusa opened this issue 10 years ago • 3 comments

Running version 0.42.0. I searched the forums I hope I didn't miss the answer. Using SAML against the directory for auth. Scenario. I just moved my user pilot database over to our production environment. Some of the users in that previous environment had lowercase email addresses such as [email protected]. In the production environment it is [email protected]. Even though the Jim Doe user is the only one in the RC system I cannot change his email from lowercase to the uppercase shown above. I get the error every time. Currently this is affecting multiple users. I don't want to delete the users since they have data and groups tied to them. Any ideas?

drickerusa avatar Oct 14 '16 18:10 drickerusa

Hey, I had a look in to this myself as we found ourself in a similar situation and I believe this to still be an issue in v0.46.0.

One (horrible) way to fix it would be to run a query in MongoDB against the database updating each e-mail address with currentValue.toLowerCase() or something similar, but this means that it could present itself as an issue again in the future. I believe it should probably be fixed in the source instead, either by sanitising the e-mail address of a user in the first place or in the saml_server.js file by doing a case-insensitive query here.

If the data is sanitised everywhere then of course the case-insensitive query is not necessary, although some kind of upgrade script would need to run to make sure the lowercase e-mail address policy is enforced against existing installations.

I'm happy to have a go at fixing this, it looks like a bit of an edge-case that is hardly affecting anyone.

jamie-owen avatar Nov 25 '16 17:11 jamie-owen

I'm not sure if this is still an issue. @Jamie-Owen if it is we definitely would accept any PR's

geekgonecrazy avatar Jul 23 '17 01:07 geekgonecrazy

@rocket-cat close

Closing this due to lack of feedback. Is this is still an issue, please do get back to me!

Cheers Thomas

TwizzyDizzy avatar Mar 03 '18 15:03 TwizzyDizzy