checkAssertion :: ByteString -> Assertion -> IO VerifierResponse
checkAssertion hostUrl (Assertion a) = do
  url <- parseUrl "https://verifier.login.persona.org/verify"
  let req = urlEncodedBody [("audience", hostUrl), ("assertion", pack a)] url
  response <- withManager . httpLbs $ req
  -- TODO: check certificate - at present we're open to a MitM
  return . fromJust . decode . responseBody $ response

-- | Check that an auth token was issued by the server, and that the user is who he thinks he is.
checkAssertion :: ByteString -> Assertion -> IO VerifierResponse
checkAssertion hostUrl (Assertion a) = do
  url <- parseUrl "https://verifier.login.persona.org/verify"
  let req = urlEncodedBody [("audience", hostUrl), ("assertion", pack a)] url
  response <- withManager . httpLbs $ req
  -- TODO: check certificate - at present we're open to a MitM
  return . fromJust . decode . responseBody $ response

-- | Check that an auth token was issued by the server, and that the user is who he thinks he is.
checkAssertion hostUrl (Assertion a) = do
  url <- parseUrl "https://verifier.login.persona.org/verify"
  let req = urlEncodedBody [("audience", hostUrl), ("assertion", pack a)] url
  response <- withManager . httpLbs $ req
  -- TODO: check certificate - at present we're open to a MitM
  return . fromJust . decode . responseBody $ response

-- | Check that an auth token was issued by the server, and that the user is who he thinks he is.