username gen

This commit is contained in:
2021-07-30 10:18:04 +03:00
parent c2361039ec
commit 8c6e1bcfa6
2 changed files with 2 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ async def register(*_, email: str, password: str) -> User:
inp = { "email": email, "password": password}
create_user = CreateUser(**inp)
create_user.password = Password.encode(create_user.password)
create_user.username = email.split('@')[0]
user = User.create(**create_user.dict())
# if not password: # TODO: send confirmation email
token = await Authorize.authorize(user)