Use Libravatar rather than tracking avatars internally
This commit is contained in:
parent
2fa69f9883
commit
64c4aab14b
6 changed files with 12 additions and 10 deletions
|
@ -217,9 +217,9 @@ instance YesodAuth App where
|
|||
case x of
|
||||
Just (Entity uid _) -> return $ Authenticated uid
|
||||
Nothing -> Authenticated <$> insert User
|
||||
{ userAvatar = Nothing
|
||||
, userIdent = credsIdent creds
|
||||
{ userIdent = credsIdent creds
|
||||
, userFullName = ""
|
||||
, userEmail = ""
|
||||
, userPassword = Nothing
|
||||
}
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
module Widget.Hcard (hcard) where
|
||||
|
||||
import Import
|
||||
|
||||
img :: Text -> Route App
|
||||
img file = StaticR . flip StaticRoute [] $ ["img", file]
|
||||
import qualified Network.Libravatar as L
|
||||
|
||||
hcard :: User -> Widget
|
||||
hcard user = $(widgetFile "hcard")
|
||||
hcard user = do
|
||||
maybeAvatar <- liftIO $ L.avatarUrl (L.Email $ userEmail user) def { L.optSecure = True, L.optSize = L.Size 512 }
|
||||
$(widgetFile "hcard")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue