aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Leech-Pepin <jonathan.leechpepin@gmail.com>2014-11-20 10:27:44 -0500
committerJonathan Leech-Pepin <jonathan.leechpepin@gmail.com>2014-11-20 10:27:44 -0500
commit52a8faf61568cb198727aad50d2ec4388a751348 (patch)
tree86db24bb3cd48c536d9b6ab90e6e6a570b44433a
parent7f041f830c8d1f9aaca0eb8a898070873668a4fd (diff)
Fix sx-auth--method-p to work correctly when there is no submethod
specified.
-rw-r--r--sx-auth.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/sx-auth.el b/sx-auth.el
index 8085098..e786466 100644
--- a/sx-auth.el
+++ b/sx-auth.el
@@ -109,7 +109,7 @@ questions)."
(defun sx-auth--method-p (method &optional submethod)
"Check if METHOD is one that may require authentication.
-If it has `auth required` SUBMETHODs, return t."
+If it has `auth-required' SUBMETHODs, or no submethod, return t."
(let ((method-auth (cdr (assoc method sx-auth-method-auth)))
;; If the submethod has additional options, they may all be
;; eligible, in which case we only need to check the `car'.
@@ -117,12 +117,14 @@ If it has `auth required` SUBMETHODs, return t."
(car submethod))))
(and method-auth
(or
+ ;; No submethod specified
+ (not submethod)
;; All submethods require auth.
(eq t method-auth)
;; All sub-submethods require auth.
(member sub-head method-auth)
;; Specific submethod requires auth.
- (member submethod method-auth))))))
+ (member submethod method-auth)))))
;; Temporary solution. When we switch to pre-defined filters we will
;; have to change the logic to match against specific filters.