From 1c45c75e0fbfd2d5f1a6b520d06c159ecbc2d249 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 16 Jul 2020 00:19:23 +0200 Subject: [PATCH] [core] Check password length --- kibicara/webapi/admin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kibicara/webapi/admin.py b/kibicara/webapi/admin.py index 0a1adda..02cb80a 100644 --- a/kibicara/webapi/admin.py +++ b/kibicara/webapi/admin.py @@ -81,6 +81,11 @@ async def admin_register(values: BodyAdmin): register_token = to_token(**values.__dict__) logger.debug(f'register_token={register_token}') # TODO implement check to see if email already is in database + if len(values.password) < 8: + logger.info('Password is too short') + raise HTTPException( + status_code=status.HTTP_400_BAD_REQUEST, detail='Password is too short' + ) try: email.send_email( to=values.email,