see #9 Merge branch 'ShaneKilkelly-master'

This commit is contained in:
liquidz 2014-09-15 23:24:02 +09:00
commit e48d4b39e2
2 changed files with 2 additions and 2 deletions

View file

@ -69,7 +69,7 @@
([this key]
(let [alg (-> this :header :alg keyword)]
(cond
(= :none alg) (= "" (:signature this))
(= :none alg) (= "" key (:signature this))
(supported-algorithm? alg)
(let [verify-fn (get-verify-fn alg)
@ -88,4 +88,3 @@
(->JWT (encoded-json->map header)
(encoded-json->map claims)
(or signature ""))))

View file

@ -93,6 +93,7 @@
(fact "Plain JWT should be verified."
(-> claim jwt verify) => true
(-> claim jwt to-str str->jwt verify) => true
(-> claim jwt to-str str->jwt (verify "foo")) => false
(-> claim jwt (assoc :signature "foo") verify) => false)
(fact "HS256 signed JWT should be verified."