Use readKey/showKey

This commit is contained in:
Michael Snoyman 2011-04-14 17:43:10 +03:00
parent b236e1f913
commit da4f679f36

View File

@ -135,8 +135,8 @@ instance YesodAuth ~sitearg~ where
Nothing -> do Nothing -> do
fmap Just $ insert $ User (credsIdent creds) Nothing fmap Just $ insert $ User (credsIdent creds) Nothing
showAuthId _ = T.pack . show showAuthId _ = showKey (undefined :: YesodDB ~sitearg~ IO a) . fromPersistKey
readAuthId _ = read . T.unpack readAuthId _ = fmap toPersistKey . readKey (undefined :: YesodDB ~sitearg~ IO a)
authPlugins = [ authOpenId authPlugins = [ authOpenId
, authEmail , authEmail
@ -145,8 +145,8 @@ instance YesodAuth ~sitearg~ where
instance YesodAuthEmail ~sitearg~ where instance YesodAuthEmail ~sitearg~ where
type AuthEmailId ~sitearg~ = EmailId type AuthEmailId ~sitearg~ = EmailId
showAuthEmailId _ = T.pack . show showAuthEmailId _ = showKey (undefined :: YesodDB ~sitearg~ IO a) . fromPersistKey
readAuthEmailId _ = read . T.unpack readAuthEmailId _ = fmap toPersistKey . readKey (undefined :: YesodDB ~sitearg~ IO a)
addUnverified email verkey = addUnverified email verkey =
runDB $ insert $ Email email Nothing $ Just verkey runDB $ insert $ Email email Nothing $ Just verkey