//$logService->log('TRACE',$server.':Environment',var_log('environment',$environment),'login');
 $access_token = authCode($code, $param);
 if (empty($access_token)) {
     if (isset($_GET['login'])) {
         $logService->log('ERROR', 'Processing login with CODE set, but no access token, calling Disqus', '', 'login');
         auth($param);
         exit;
     }
 } else {
     $logService->log('TRACE', 'Authorization a success, looking up / creating a user', '', 'login');
     //authorization a success
     $obj = getUserData();
     if ($obj) {
         $old_identity = $identity;
         if ($old_identity) {
             $old_user = $ds->getUser($old_identity);
             $old_username = $old_user['username'];
             if (stripos($old_username, 'anon') === FALSE) {
                 $old_identity = false;
             }
         }
         $identity = $obj->emailHash;
         if ($identity) {
             $old_user = $ds->getUser($identity);
             if ($old_user) {
                 $old_identity = false;
             }
         }
         if (empty($identity)) {
             // fixing a bug in disqus
             $email = $obj->email;