From add9d4393a365b58c2e3a82f76f3ca58b9487a3f Mon Sep 17 00:00:00 2001 From: Bryan Richter Date: Mon, 3 Oct 2016 08:58:27 -0700 Subject: [PATCH] Comment on unsafePerformIO, close #1245 --- yesod-auth/Yesod/Auth/Email.hs | 2 ++ yesod-auth/Yesod/Auth/GoogleEmail2.hs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/yesod-auth/Yesod/Auth/Email.hs b/yesod-auth/Yesod/Auth/Email.hs index c7e26db9..777be439 100644 --- a/yesod-auth/Yesod/Auth/Email.hs +++ b/yesod-auth/Yesod/Auth/Email.hs @@ -710,6 +710,8 @@ setLoginLinkKey aid = do setSession loginLinkKey $ TS.pack $ show (toPathPiece aid, now) +-- See https://github.com/yesodweb/yesod/issues/1245 for discussion on this +-- use of unsafePerformIO. defaultNonceGen :: Nonce.Generator defaultNonceGen = unsafePerformIO (Nonce.new) {-# NOINLINE defaultNonceGen #-} diff --git a/yesod-auth/Yesod/Auth/GoogleEmail2.hs b/yesod-auth/Yesod/Auth/GoogleEmail2.hs index 82a80a77..fb8d9f43 100644 --- a/yesod-auth/Yesod/Auth/GoogleEmail2.hs +++ b/yesod-auth/Yesod/Auth/GoogleEmail2.hs @@ -574,6 +574,8 @@ allPersonInfo (A.Object o) = map enc $ M.toList o allPersonInfo _ = [] +-- See https://github.com/yesodweb/yesod/issues/1245 for discussion on this +-- use of unsafePerformIO. defaultNonceGen :: Nonce.Generator defaultNonceGen = unsafePerformIO (Nonce.new) {-# NOINLINE defaultNonceGen #-}