User need to verify their email by clicking on the link sent by email. The link is like:
http://www.example.com/wp-login.php?token=afdsDEDFdfsSE234&user_id=13
And I have used wp_authenticate
hook to verify the token of the user:
add_action( 'wp_authenticate', array($this, 'verify_token'), 30, 2);
and the callback function:
public function verify_token()
{
$user_token = afdsDEDFdfsSE234;
if($user_token == $_GET['token'])
{
apply_filters( 'login_message', __('Token mathed. Now login!','user-registration'));
}
}