diff options
author | Jonathan Leech-Pepin <jonathan.leechpepin@gmail.com> | 2014-11-20 10:27:44 -0500 |
---|---|---|
committer | Jonathan Leech-Pepin <jonathan.leechpepin@gmail.com> | 2014-11-20 10:27:44 -0500 |
commit | 52a8faf61568cb198727aad50d2ec4388a751348 (patch) | |
tree | 86db24bb3cd48c536d9b6ab90e6e6a570b44433a /sx-auth.el | |
parent | 7f041f830c8d1f9aaca0eb8a898070873668a4fd (diff) |
Fix sx-auth--method-p to work correctly when there is no submethod
specified.
Diffstat (limited to 'sx-auth.el')
-rw-r--r-- | sx-auth.el | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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. |