diff options
author | William Carroll <wpcarro@gmail.com> | 2020-08-08T12·46+0100 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2020-08-08T12·46+0100 |
commit | 526728eb89963f558566b4ceb3cb95e4921c0866 (patch) | |
tree | ebdd14966f0e1047f14b602a8a52a9d97244f0b4 | |
parent | d34b146702476f46bcca7d362e56f46227863f1b (diff) |
Test that an improperly encoded JWT returns a DecodeError
The subject of this commit message says it all.
-rw-r--r-- | website/sandbox/learnpianochords/src/server/Spec.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/website/sandbox/learnpianochords/src/server/Spec.hs b/website/sandbox/learnpianochords/src/server/Spec.hs index 6c683cbbf2a7..20c7b96b952f 100644 --- a/website/sandbox/learnpianochords/src/server/Spec.hs +++ b/website/sandbox/learnpianochords/src/server/Spec.hs @@ -16,6 +16,9 @@ main = hspec $ do describe "GoogleSignIn" $ describe "jwtIsValid" $ do let jwtIsValid' = GoogleSignIn.jwtIsValid True + it "returns a decode error when an incorrectly encoded JWT is used" $ do + jwtIsValid' (GoogleSignIn.EncodedJWT "rubbish") `shouldReturn` DecodeError + it "returns validation error when the aud field doesn't match my client ID" $ do let auds = ["wrong-client-id"] |> fmap TestUtils.unsafeStringOrURI |