Roles are not correct while getting it in hook_user I have added a new role called pre-auth i.e. if a user is registered and has not clicked the confirmation link(using LoginToboggan module) from the mail and the other is authenticated role its the normal authenticated role. I have a hook_user to check the role but it gives me as "authenticated user " always but in admin/user/user/ it shows the role as  "pre-auth" 

function mynewmod_user($op, &amp;$edit, &amp;$account, $category = NULL){
  switch ($op){
  case 'insert':
  case 'after_update':
    $user_details = user_load($account-&gt;uid);
    drupal_set_message('&lt;pre&gt;'. print_r($user_details-&gt;roles, true) .'&lt;/pre&gt;');
}


Can any one tell me how can I get the exact role.
The variable $account already has the loaded user object. Calling $account->roles will give you an array of roles.