Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case sensitive emails #2698

Open
simondate opened this issue Feb 27, 2023 · 4 comments
Open

Case sensitive emails #2698

simondate opened this issue Feb 27, 2023 · 4 comments

Comments

@simondate
Copy link
Member

simondate commented Feb 27, 2023

I've discovered after upgrading a client from AAT 0.10.5 to AAT 0.11.1 that the majority of their users were no longer able to log in to the Authoring Tool.

After spending an hour head-scratching what the issue was, I noticed that some users had capitalised letters in their email addresses and others didn't. It appears that those users weren't able to log in.

It appears that if you try to create new users, after upgrading with capitalised letters, it automatically replaces the capitalised letters for non-capitalised, preventing this happening for new AAT installs, but the upgrade script didn't account for this and these users were unable to access the Authoring Tool until the administrator changed their names manually.

Steps to Reproduce

  1. Have an older version of the AAT with email addresses which have capital letters in.
  2. Upgrade to AAT 0.11.1
  3. Notice the users are no longer able to login or have their passwords changed until their email address has been changed manually.
@simondate
Copy link
Member Author

#2060

@taylortom taylortom added this to the v0.11.2 milestone Mar 23, 2023
@cksachdev
Copy link
Contributor

A quick fix, is to update the records in users collection. Here is a sample script which can be executed in mongo shell.

show dbs;
use adapt-tenant-master;
db.users.find({}).forEach(function(doc){ 
	var email = doc.email.toLowerCase();
	db.users.update({_id:doc._id},  {$set: {"email": email} });
});

Verifying after executing the above script.

db.users.find({}).pretty();

@simondate
Copy link
Member Author

Add the above code to migration script

@taylortom taylortom mentioned this issue May 19, 2023
3 tasks
@simondate simondate removed this from the v0.11.2 milestone Jul 5, 2023
@simondate
Copy link
Member Author

Removed from 0.11.2 milestone as it has been agreed that this is out of scope.

Anyone upgrading from older versions can use the information on this issue to upgrade using the Mongo script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants