loginUser :: Connection 
          -> Text -- ^ Username
          -> Text -- ^ Password (plaintext)
          -> ActionM (Maybe CardUserSession)
loginUser conn uname passwd = do
  user <- getUserByCredentials conn uname passwd
  case user of
    Nothing -> return Nothing
    Just (CardUser{..}) -> createSession conn id
loginUser :: Connection 
          -> Text -- ^ Username
          -> Text -- ^ Password (plaintext)
          -> ActionM (Maybe CardUserSession)
loginUser conn uname passwd = do
  user <- getUserByCredentials conn uname passwd
  case user of
    Nothing -> return Nothing
    Just (CardUser{..}) -> createSession conn id
loginUser conn uname passwd = do
  user <- getUserByCredentials conn uname passwd
  case user of
    Nothing -> return Nothing
    Just (CardUser{..}) -> createSession conn id