about summary refs log tree commit diff
path: root/website/sandbox/learnpianochords/src/server/TestUtils.hs
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-08-08T13·47+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-08-08T13·47+0100
commit8a7a3b29a9413d634b8f8a71119cc54a6132df41 (patch)
treefc32f99e9f1a9a7b9ef52f364718c56d33ccedcf /website/sandbox/learnpianochords/src/server/TestUtils.hs
parentf1883b279037375c66cf683b7392652624381c59 (diff)
Add tests for "exp" field of the JWT
Assert that the exp field of the JWT is "fresh".
Diffstat (limited to 'website/sandbox/learnpianochords/src/server/TestUtils.hs')
-rw-r--r--website/sandbox/learnpianochords/src/server/TestUtils.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/website/sandbox/learnpianochords/src/server/TestUtils.hs b/website/sandbox/learnpianochords/src/server/TestUtils.hs
index c586f7f219ba..e62950369e65 100644
--- a/website/sandbox/learnpianochords/src/server/TestUtils.hs
+++ b/website/sandbox/learnpianochords/src/server/TestUtils.hs
@@ -10,3 +10,7 @@ unsafeStringOrURI x =
   case stringOrURI (cs x) of
     Nothing -> error $ "Failed to convert to StringOrURI: " ++ x
     Just x  -> x
+
+unsafeJust :: Maybe a -> a
+unsafeJust Nothing = error "Attempted to force a Nothing to be a something"
+unsafeJust (Just x) = x