confirm email on user registration improve
This commit is contained in:
@@ -46,14 +46,9 @@ async def register(*_, email: str, password: str = ""):
|
||||
session.add(user)
|
||||
session.commit()
|
||||
|
||||
await UserStorage.add_user(user)
|
||||
await send_confirm_email(user)
|
||||
|
||||
if not password:
|
||||
await send_confirm_email(user)
|
||||
return { "user": user }
|
||||
|
||||
token = await Authorize.authorize(user)
|
||||
return {"user": user, "token": token }
|
||||
return { "user": user }
|
||||
|
||||
@mutation.field("requestPasswordUpdate")
|
||||
async def request_password_update(_, info, email):
|
||||
@@ -95,6 +90,9 @@ async def login(_, info: GraphQLResolveInfo, email: str, password: str = ""):
|
||||
await send_auth_email(orm_user)
|
||||
return {}
|
||||
|
||||
if not orm_user.emailConfirmed:
|
||||
return {"error" : "email not confirmed"}
|
||||
|
||||
try:
|
||||
device = info.context["request"].headers['device']
|
||||
except KeyError:
|
||||
|
Reference in New Issue
Block a user