adapt_authoring
adapt_authoring copied to clipboard
Case sensitive emails
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
- Have an older version of the AAT with email addresses which have capital letters in.
- Upgrade to AAT 0.11.1
- Notice the users are no longer able to login or have their passwords changed until their email address has been changed manually.
https://github.com/adaptlearning/adapt_authoring/issues/2060
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();
Add the above code to migration script
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