I'm trying to implement custom email verification for user sign up. The default one only sends plain text messages, but we want to send HTML formatted ones.
The current approach:
Parse.Cloud.beforeSave("Parse.User"…
sets a generated token in the user's 'confirmationToken
' fieldconfirmationToken
like this http://www.our-website.com/confirm_email.php?confirmationToken=confirmationToken
confirmationToken
field's value that matches the token from the requestemailVerified
field to true
…Now here's the problem. The emailVerified
field seems to be protected. Trying to set it will give you a ParseException
'InvalidKeyName' (105). Now, I could just use another field, but the problem is that we had set up the default Parse email verification previously, and our apps are looking for that value in emailVerified
. Users already signed up with the default email verification, and we cannot just change it because the apps are deployed.
Is there any way we can set the emailVerified
field?
Can anyone think of a solution that will also work for apps that are already checking for this field, even though in the future we'd have to set another one?
Is the field still protected if you disable email verification (right now it is still enabled)?
Any help is greatly appreciated.
Unfortunately, the emailVerified
attribute cannot be set, even using the master key. The only alternative is to create a custom verified attribute to go along with the custom verification logic.
The approach I'd take would be this:
emailVerified
afterSave
for any Parse.User
I realize that step 4. violates a premise of the question, but your app must designed under the premise that the client can and will be revised. If its not this issue, it will be another. Operating conditions will change, and so must your client.