Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created December 1, 2017 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/fd2cc916721d49870a2100100872366e to your computer and use it in GitHub Desktop.
Save deque-blog/fd2cc916721d49870a2100100872366e to your computer and use it in GitHub Desktop.
encryptToken :: (ToJSON t, MonadCypher m) => t -> m String
encryptToken = encryptJson . toJson
decryptToken :: (FromJSON t, MonadCypher m) => String -> m (Maybe t)
decryptToken str = (fmap . fmap) fromJson (decryptJson str)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment