I faced the same problem a few days ago, I was using this logintoboggan module but didn't want my user to confirm emails, just register with password and login as well, so what I did is to remove the 'non-authenticate' user role from the user and add 'authenticate' role when the user login for the first time.
/**
* Implements hook_user_login().
*/
function mymodule_user_login(&$edit, $account) {
if (in_array('non authenticated user', $account->roles)) {
// remove non-auth role from user object.
_remove_role_from_user($uid, 'non authenticated user');
// Add auth role to user object.
_add_role_to_user($uid, 'authenticated user');
}
}
function _add_role_to_user($user, $role_name) {
// For convenience, we'll allow user ids as well as full user objects.
if (is_numeric($user)) {
$user = user_load($user);
}
// If the user doesn't already have the role, add the role to that user.
$key = array_search($role_name, $user->roles);
if ($key == FALSE) {
// Get the rid from the roles table.
$roles = user_roles(TRUE);
$rid = array_search($role_name, $roles);
if ($rid != FALSE) {
$new_role[$rid] = $role_name;
$all_roles = $user->roles + $new_role; // Add new role to existing roles.
user_save($user, array('roles' => $all_roles));
}
}
}
function _remove_role_from_user($user, $role_name) {
// For convenience, we'll allow user ids as well as full user objects.
if (is_numeric($user)) {
$user = user_load($user);
}
// Only remove the role if the user already has it.
$key = array_search($role_name, $user->roles);
if ($key == TRUE) {
// Get the rid from the roles table.
$roles = user_roles(TRUE);
$rid = array_search($role_name, $roles);
if ($rid != FALSE) {
// Make a copy of the roles array, without the deleted one.
$new_roles = array();
foreach($user->roles as $id => $name) {
if ($id != $rid) {
$new_roles[$id] = $name;
}
}
user_save($user, array('roles' => $new_roles));
}
}
}