Clean up user entity - remove unused fields, adjust order
This commit is contained in:
parent
4023b17e85
commit
a070ceef3c
4 changed files with 10 additions and 26 deletions
|
@ -188,15 +188,14 @@ instance YesodAuth App where
|
|||
redirectToReferer _ = True
|
||||
|
||||
authenticate creds = runDB $ do
|
||||
x <- getBy $ UniqueUser $ credsIdent creds
|
||||
x <- getBy . UniqueUsername $ credsIdent creds
|
||||
case x of
|
||||
Just (Entity uid _) -> return $ Authenticated uid
|
||||
Nothing -> Authenticated <$> insert User
|
||||
{ userIdent = credsIdent creds
|
||||
{ userUsername = credsIdent creds
|
||||
, userFullName = ""
|
||||
, userEmail = ""
|
||||
, userNote = ""
|
||||
, userPassword = Nothing
|
||||
}
|
||||
|
||||
-- You can add other plugins like Google Email, email or OAuth here
|
||||
|
|
|
@ -10,5 +10,5 @@ import Widget.Hcard (hcard)
|
|||
|
||||
getHomeR :: Handler Html
|
||||
getHomeR = do
|
||||
user <- runDB . getBy404 $ UniqueUser "dani"
|
||||
user <- runDB . getBy404 $ UniqueUsername "dani"
|
||||
defaultLayout $(widgetFile "home")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue