I’m wondering if there is a vetted way to use a plugin to convert login authentication from username to email?
I’m seeing the following post from @bobray in the old forums, but I’m not having much success with it and hoping someone could elaborate on the code for me… Forum Article
A plugin from his response is copied below:
if (strpos($username, '@') !== false) {
$profile = $modx->getObject('modUserProfile', array('email' => $username));
if ($profile) {
$usr = $profile->getOne('User');
if ($usr) {
if ($usr->passwordMatches($password)) {
return true;
}
}
}
}
return false;