Hash passwords when creating accounts

TL;DR:
- introduce the Cryptonite library
- Remove the redundant language extensions, imports, deps from Persistent
- Prefer NoContent return type for POST /accounts
- Define custom {To,From}JSON instances for Role
This commit is contained in:
William Carroll 2020-07-28 12:49:16 +01:00
parent bb36dd1f9e
commit b170be9375
4 changed files with 76 additions and 52 deletions

View file

@ -12,8 +12,8 @@ import qualified Types as T
type API =
-- accounts: Create
"accounts"
:> ReqBody '[JSON] T.Account
:> Post '[JSON] (Maybe T.Session)
:> ReqBody '[JSON] T.CreateAccountRequest
:> Post '[JSON] NoContent
-- accounts: Read
-- accounts: Update
-- accounts: Delete