adapt_authoring icon indicating copy to clipboard operation
adapt_authoring copied to clipboard

Case sensitive emails

Open simondate opened this issue 2 years ago • 4 comments

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 avatar Feb 27 '23 16:02 simondate

https://github.com/adaptlearning/adapt_authoring/issues/2060

simondate avatar Mar 01 '23 15:03 simondate

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();

cksachdev avatar Mar 27 '23 13:03 cksachdev

Add the above code to migration script

simondate avatar Apr 18 '23 13:04 simondate

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

simondate avatar Jul 05 '23 12:07 simondate