1
votes

In my app I am using Parse as a back-end. I want to convert the username to case insensitive. I found this which is cool, but my problem is that I already have a lot of accounts that contain Camel cased usernames.

My idea is to use cloud code to detect a login attempt. If I can run code before a signup or a login, I can then convert the incoming and the stored username texts to lowercase, compare them, and then be on my way.

Is something like this possible? I am not very good with parses cloud code, can this be done?

The steps to achieve the idea in that post are (1) add an all-lowercase-email column to your user, (2) write migration function (probably in cloud code) that reads all users and writes the lowercase col for each and saves all, run that function once, say via curl, (3) add a beforeSave hook on user that initializes that column for all new users in the future. The step (2) migration function is a one-time action.danh