Skip to content

Instantly share code, notes, and snippets.

@codedmart
Created October 16, 2014 15:44
Show Gist options
  • Save codedmart/c1eab161174570930a9b to your computer and use it in GitHub Desktop.
Save codedmart/c1eab161174570930a9b to your computer and use it in GitHub Desktop.
verify j = case J.verify (J.secret $ pack "secret-key") =<< J.decode j of
Nothing -> return Nothing
Just j -> do
r <- expired j
case r of
Just True -> return $ Just j
_ -> return Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment