From 1baabc8f2d0631f8f4308400f9a53f1aadd58d14 Mon Sep 17 00:00:00 2001 From: Nathaniel Nicandro Date: Wed, 5 Jul 2023 20:29:01 -0500 Subject: [PATCH] jupyter-tramp-server-from-file-name: Fix password authenticator fixes #480 --- jupyter-rest-api.el | 5 +++-- jupyter-tramp.el | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jupyter-rest-api.el b/jupyter-rest-api.el index ac4c4027..ccabb6f2 100644 --- a/jupyter-rest-api.el +++ b/jupyter-rest-api.el @@ -532,8 +532,9 @@ slot of CLIENT and restore the AUTH slot on failure." &optional passwd) "Authenticate CLIENT by asking for a password. If PASSWD is provided it must be a function that takes zero -arguments. It will be called before each authentication attempt. -If CLIENT could not be authenticated raise an error." +arguments and returns a password, it defaults to a call to +`read-passwd'. It will be called before each authentication +attempt. If CLIENT could not be authenticated raise an error." (or (functionp passwd) (setq passwd (lambda () (read-passwd (format "Password [%s]: " (oref client url)))))) diff --git a/jupyter-tramp.el b/jupyter-tramp.el index b66dc5c4..cbe49feb 100644 --- a/jupyter-tramp.el +++ b/jupyter-tramp.el @@ -312,10 +312,9 @@ fails." (jupyter-api-authenticate client 'password (let ((remote (file-remote-p filename))) - (lambda (try) + (lambda () (jupyter-tramp-read-passwd - filename (unless (zerop try) - (format "Password for %s " remote)))))))))))))) + filename (format "Password [%s]: " remote))))))))))))) ;;; Getting information about file models