- = do userID <- getUserID env
- when (isNothing userID)
- $ abort Forbidden [] Nothing
-
- path <- getPathInfo
- case path of
- [name] -> do mimeType <- getContentType
- case mimeType of
- Nothing
- -> abort BadRequest [] (Just "Missing Content-Type")
- Just (MIMEType "text" "plain" _)
- -> do pass <- input defaultLimit
- addUser (envAuthDB env) name pass
- Just t
- -> abort UnsupportedMediaType [] (Just $ "Unsupported media type: " ++ show t)
- setStatus Created
- _ -> abort BadRequest [] (Just "Invalid URI")
-
+ = do userID ← getUserID env
+ when (isNothing userID)
+ $ abort Forbidden [] Nothing