--- logintoboggan.module.dist	2007-02-13 07:56:32.000000000 -0800
+++ logintoboggan.module	2007-02-13 07:55:38.000000000 -0800
@@ -308,7 +308,9 @@
       if (!$user->uid) {
         form_set_error('login', t('Sorry. Unrecognized username or password.') .' '. l(t('Have you forgotten your password?'), 'user/password'));
         watchdog('user', t('Login attempt failed for %user.', array('%user' => theme('placeholder', $form_values['name']))));
-        drupal_goto('user/login');
+        $destination = $_REQUEST['destination'];
+        unset($_REQUEST['destination']);
+        drupal_goto('user/login','destination='.$destination);
       }
     }
   }
