# TODO: Post sign up logic
if response.created_new_user:
# print("Sing up new user: ")
id = uuid.uuid4().__str__()
# create user metadata in supertoken table.
await update_user_metadata(user_id, {
"id": id,
"profilePic": "None",
"firstname": "None",
"lastname": "None",
"email": email,
"phone": phone_number,
"gender": "None",
"third_party_info": third_party_info.__str__(),
"date_of_birth": "'1515-10-10'",
})
print('Data --- > ', email, phone_number, third_party_info, third_party_info)
# inserting data into user database .
user = UserModel.create(
id=id,
user_id=user_id,
firstname='None',
lastname='None',
gender='None',
profilePic='None',
email=email,
phone=phone_number,
third_party_info=third_party_info.__str__(),
date_of_birth=datetime.strptime(str('1515-10-10'), "%Y-%m-%d").date(),
)
async with async_session_factory() as session:
session.add(user)
await session.commit()
await session.close()
else:
print('Data --- > ', email, phone_number, third_party_info)
# print(third_party_info.id)
# print("Sing in new user")
return response
original_implementation.consume_code_post = consume_code_post
return original_implementation