-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
auth-source-search
not returning :secret
in Emacs 25.2.2
#64
Comments
The diff --git a/ghub.el b/ghub.el
index 4894e7b..b6b1ef8 100644
--- a/ghub.el
+++ b/ghub.el
@@ -683,8 +683,8 @@ (defun ghub--token (host username package &optional nocreate forge)
;; value, but in our case that is a situation that needs
;; fixing so we want to keep trying by invalidating that
;; information. The (:max 1) is needed for Emacs releases
- ;; before 26.1.
- (auth-source-forget (list :max 1 :host host :user user))
+ ;; before 26.1. #24 #64
+ (auth-source-forget (list :host host :user user :max 1))
(and (not nocreate)
(if (eq forge 'gitlab)
(error
@@ -819,7 +819,8 @@ (defun ghub--read-2fa-code ()
(defun ghub--auth-source-get (keys &rest spec)
(declare (indent 1))
- (let ((plist (car (apply #'auth-source-search :max 1 spec))))
+ (let ((plist (car (apply #'auth-source-search
+ (append spec (list :max 1))))))
(mapcar (lambda (k)
(plist-get plist k))
keys))) |
That works perfectly, thanks. Thanks for all your hard work on magit, I use it everyday at work and it saves me so much time! I supported your Kickstarter and I'd be happy to do so again. |
You're weclome and thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had a little struggle to debug why I was always getting prompted to create a token when calling
ghub-get
and friends. I found in the end that the call toauth-source-search
inghub--auth-source-get
doesn't return any value for the:secret
key when:max 1
is passed. If:max 2
or higher is passed or the argument is not passed then:secret
is present. With Emacs 26.1 this works as expected.My
.authinfo
file is as follows:I raise this here because I saw you said in #57 that this package patches
auth-source
. Let me know if I can provide any further information.The text was updated successfully, but these errors were encountered: