handleLogin :: H ()
handleLogin = method POST go
  where
    go = runHttpErrorExceptT $ do
      login      <- lift reqJSON
      userOrErr  <- lift $ with jwt $ J.loginUser (lpLogin login) (lpPass login)
      return (either handleLoginError loginOK userOrErr)

-- | The application's routes.
handleLogin :: H ()
handleLogin = method POST go
  where
    go = runHttpErrorExceptT $ do
      login      <- lift reqJSON
      userOrErr  <- lift $ with jwt $ J.loginUser (lpLogin login) (lpPass login)
      return (either handleLoginError loginOK userOrErr)

-- | The application's routes.
handleLogin = method POST go
  where
    go = runHttpErrorExceptT $ do
      login      <- lift reqJSON
      userOrErr  <- lift $ with jwt $ J.loginUser (lpLogin login) (lpPass login)
      return (either handleLoginError loginOK userOrErr)

-- | The application's routes.