--- loncom/auth/migrateuser.pm	2005/10/28 21:51:43	1.3
+++ loncom/auth/migrateuser.pm	2005/12/28 19:26:02	1.4
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Starts a user off based of an existing token.
 #
-# $Id: migrateuser.pm,v 1.3 2005/10/28 21:51:43 albertel Exp $
+# $Id: migrateuser.pm,v 1.4 2005/12/28 19:26:02 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -60,7 +60,12 @@ sub handler {
     my ($r) = @_;
     
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['token']);
-    my %data = &Apache::lonnet::tmpget($env{'form.token'});
+    my %data =   &Apache::lonnet::tmpget($env{'form.token'});
+    my $delete = &Apache::lonnet::tmpdel($env{'form.token'});
+
+    if ($delete ne 'ok') {
+	return &goto_login($r);
+    }
 
     if ($data{'ip'} ne $ENV{'REMOTE_ADDR'} || !defined($data{'username'}) ||
 	!defined($data{'domain'}) ) {