[core] Check password length
This commit is contained in:
parent
277eb77047
commit
1c45c75e0f
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue