Hello Brajesh,
I recently purchased the BuddyPress Auto Activate Auto Login plugin, but I realised the the plugin does not work with Email address being used as login input instead of username. My site uses email address instead of username to login for security reasons.
When I register a new user, the account becomes active automatically but the automatic login fails because i’m using email address instead of username.
Tosin
Hi Tosin,
Thank you for reporting. I am pushing an update today. It has been long due for the Auto Activate as well as the Ajax Registration plugin since WordPress not supports email login out of the box.Please allow me to have an update by day end today.
Regards
BrajeshHi Tosin,
I checked the plugin now. It is working for me even if I use the email as username. Are you using any plugin that prevents login by username? That may be the reason.Please let me know and I will assist further.
Thank you
BrajeshHello Brajesh,
I’m using a plugin to prevent usernames and accept only on email address on login, is there a way to work around this because I don’t want my users to be able to login using their username but only their email address.
1. For security reasons logins with email address is better as I want to use usernames for communication purpose only in the community.
2. Users cannot easily identity another user’s email address unlike usernames that are publicly visible during communication in buddypress.
Thanks
Hi Tosin,
No problem. Please let me know if you are accomplishing it via some plugin or code and I can add compatibility.I need to know about the above to devise a strategy for authenticating via email instead of username.
Regards
BrajeshHello Brajesh,
I am using two methods to achieve (1) through the ithemes security plugin (2) through custom code in my functions.php file
1. Using the ithemes security plugin by navigating to settings the wordpress tweaks
2. Below is the custom code applied to my functions.php file
/* ------------------------------------------------------------------------- * * Remove WordPress default authentication function /* ------------------------------------------------------------------------- */ remove_filter('authenticate', 'wp_authenticate_username_password', 20); /* ------------------------------------------------------------------------- * * Add custom authentication function /* ------------------------------------------------------------------------- */ add_filter('authenticate', function($user, $email, $password){ //Check for empty fields if(empty($email) || empty ($password)){ //create new error object and add errors to it. $error = new WP_Error(); if(empty($email)){ //No email $error->add('empty_username', __('<strong>ERROR</strong>: Email field is empty.')); } else if(!filter_var($email, FILTER_VALIDATE_EMAIL)){ //Invalid Email $error->add('invalid_username', __('<strong>ERROR</strong>: Email is invalid.')); } if(empty($password)){ //No password $error->add('empty_password', __('<strong>ERROR</strong>: Password field is empty.')); } return $error; } //Check if user exists in WordPress database $user = get_user_by('email', $email); //bad email if(!$user){ $error = new WP_Error(); $error->add('invalid', __('<strong>ERROR</strong>: Either the email or password you entered is invalid.')); return $error; } else{ //check password if(!wp_check_password($password, $user->user_pass, $user->ID)){ //bad password $error = new WP_Error(); $error->add('invalid', __('<strong>ERROR</strong>: Either the email or password you entered is invalid.')); return $error; }else{ return $user; //passed } } }, 20, 3);
Thank you
Hi Tosin,
Please upgrade to 1.4.7
https://buddydev.com/plugins/bp-auto-activate-auto-login/After that, please put this in in your bp-custom.php
add_filter( 'bp_autoactivate_use_email_login', '__return_true' );
That will do it.
Regards
Brajesh
The topic ‘ [Resolved] BuddyPress Auto Activate Auto Login email login problem’ is closed to new replies.