User.getUidByEmail cannot find email?
-
Hello,
I just had to do a mass update on the user objects in the DB, i updated all of the user emails to our new emails. When i look in the DB i can see that the email field has been updated correctly but the User.getUidByEmail in my AUTH plugin cannot find any of the new emails..
User.getUidByEmail can however still see the old emails, is there another index somewhere that i need to update?
Thanks,
UPDATE Incase it was case sensitive i updated all of the emails to uppercase and then forced the users email address to upper case in the login plugin. Still the same.. it can see the old emails but not the new.
-
You have to update other objects in the database. Namely
email:uid
andemail:sorted
. These are created like this on user creation.async.parallel([ async.apply(db.sortedSetAdd, 'email:uid', userData.uid, userData.email.toLowerCase()), async.apply(db.sortedSetAdd, 'email:sorted', 0, userData.email.toLowerCase() + ':' + userData.uid), ], next);
-
@baris said in User.getUidByEmail cannot find email?:
email:uid
Thanks @boris
I saw these earlier but couldnt find a way that they were linked to the user object.. Is there a way to link them back now that i have already changed the email in the user object?
Link them back as in find them based on some info in the user object so that i can update them?
hmm.. looks like the email:uid object has a score equal to the user number in the _key field of the user object and the email:sorted has the value field ending in email:id (id that seems to equal the user number in the _key field of the user object. I guess thats how id link them?
Thanks,