From 225c80f2f9991bfe10d355bacf6a8e5f03a96e5d Mon Sep 17 00:00:00 2001 From: profitroll Date: Tue, 10 Jan 2023 15:24:36 +0100 Subject: [PATCH] User creation should now be x-www-form-urlencoded --- extensions/users.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/users.py b/extensions/users.py index 393be62..5be5905 100644 --- a/extensions/users.py +++ b/extensions/users.py @@ -50,7 +50,7 @@ if configGet("registration_requires_confirmation") is True: if configGet("registration_enabled") is True: @app.post("/users") - async def user_create(user: str, email: str, password: str): + async def user_create(user: str = Form(), email: str = Form(), password: str = Form()): if col_users.find_one( {"user": user} ) is not None: return HTTPException(HTTP_406_NOT_ACCEPTABLE, detail=configGet("user_already_exists", "messages")) col_users.insert_one( {"user": user, "email": email, "hash": get_password_hash(password), "disabled": configGet("registration_requires_confirmation")} )