Don't store the user's pass phrase if the login fails.
authorChris Hanson <org/chris-hanson/cph>
Thu, 25 May 2000 05:17:35 +0000 (05:17 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 25 May 2000 05:17:35 +0000 (05:17 +0000)
v7/src/imail/imail-imap.scm
v7/src/imail/imail-top.scm

index 1a5fced5f9a125b84f62ffa57cd2c2dfc42723cc..0be98f241a601c35eb6a33c8d39ef61c58f0c483 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: imail-imap.scm,v 1.90 2000/05/25 05:01:40 cph Exp $
+;;; $Id: imail-imap.scm,v 1.91 2000/05/25 05:16:36 cph Exp $
 ;;;
 ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
 ;;;
                   (lambda (condition)
                     (let ((response (imap:server-error:response condition)))
                       (if (imap:response:no? response)
-                          (error
-                           "Unable to log in:"
-                           (imap:response:response-text-string response)))))
+                          (begin
+                            (imail-delete-stored-pass-phrase url)
+                            (error "Unable to log in:"
+                                   (imap:response:response-text-string
+                                    response))))))
                 (lambda ()
-                  (imail-call-with-pass-phrase
-                   (imap-connection-url connection)
-                   (lambda (pass-phrase)
-                     (imap:command:login connection
-                                         (imap-url-user-id url)
-                                         pass-phrase)))))
+                  (imail-call-with-pass-phrase url
+                    (lambda (pass-phrase)
+                      (imap:command:login connection
+                                          (imap-url-user-id url)
+                                          pass-phrase)))))
               (set! finished? #t))
             (lambda ()
               (if (not finished?)
index fe30e984cf7203aac26f011309e2f6f4471136df..fcf079280891d09eaadd7c184a1e1d5a3ac2116e 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: imail-top.scm,v 1.108 2000/05/25 05:06:38 cph Exp $
+;;; $Id: imail-top.scm,v 1.109 2000/05/25 05:17:35 cph Exp $
 ;;;
 ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
 ;;;
@@ -293,6 +293,9 @@ regardless of the folder type."
                    entry)))
             (receiver pass-phrase)))))))
 
+(define (imail-delete-stored-pass-phrase url)
+  (hash-table/remove! memoized-pass-phrases (url-pass-phrase-key url)))
+
 (define (set-up-pass-phrase-timer! entry key retention-time)
   ;; A race condition can occur when the timer event is re-registered.
   ;; If the previous timer event is queued but not executed before