I will share a solution for enabling email verification for specific users only.
I hope this will be helpful to developers in a similar situation as mine.
I found a hint on GitHub:
// ParseServer config
const config = {
...
verifyUserEmails: true,
sendUserEmailVerification: (req) => {
// console.log(req)
const role = req.user.get('role'); // my custom user field
const emailVerified = req.user.get('emailVerified');
if(role !== 'expert' || emailVerified){
return false;
}
return true;
},
...
const server = new ParseServer(config);
Did you try whether password reset, manually changing email via dashboard, and auth login (e.g. Facebook) still work with that conditional verification? You’d want to observe what happens to the email verified flag, and to the actual action that is being taken (e.g. password reset). There may be interdependencies here.