From da4f679f3644c10a960e4720d9feca62cbc94585 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 14 Apr 2011 17:43:10 +0300 Subject: [PATCH] Use readKey/showKey --- scaffold/sitearg_hs.cg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scaffold/sitearg_hs.cg b/scaffold/sitearg_hs.cg index 8ab1ac81..3ce995ee 100644 --- a/scaffold/sitearg_hs.cg +++ b/scaffold/sitearg_hs.cg @@ -135,8 +135,8 @@ instance YesodAuth ~sitearg~ where Nothing -> do fmap Just $ insert $ User (credsIdent creds) Nothing - showAuthId _ = T.pack . show - readAuthId _ = read . T.unpack + showAuthId _ = showKey (undefined :: YesodDB ~sitearg~ IO a) . fromPersistKey + readAuthId _ = fmap toPersistKey . readKey (undefined :: YesodDB ~sitearg~ IO a) authPlugins = [ authOpenId , authEmail @@ -145,8 +145,8 @@ instance YesodAuth ~sitearg~ where instance YesodAuthEmail ~sitearg~ where type AuthEmailId ~sitearg~ = EmailId - showAuthEmailId _ = T.pack . show - readAuthEmailId _ = read . T.unpack + showAuthEmailId _ = showKey (undefined :: YesodDB ~sitearg~ IO a) . fromPersistKey + readAuthEmailId _ = fmap toPersistKey . readKey (undefined :: YesodDB ~sitearg~ IO a) addUnverified email verkey = runDB $ insert $ Email email Nothing $ Just verkey