Manual creation password encryption
I'm trying to create a user manually without passing through the register mutation. Something like this:
user = CustomUser.objects.create(
username=response['email'],
first_name=response['first_name'],
last_name=response['last_name'],
mobile=response['mobile'],
email=response['email'],
password=password,
)
But the password passes through some encryption I can't reproduce here. I couldn't find it in the doc, or anywhere on the Internet, and can't find it in the source code. How does that work? How can I encrypt it correctly?
I'm not sure this is the right place to answer it, it looks like more of Django question than graphql to me. Giving a proper answer without knowing how CustomUser is implemented is not really possible but you may want to check https://docs.djangoproject.com/en/3.1/ref/contrib/auth/#django.contrib.auth.models.UserManager.create_user and https://docs.djangoproject.com/en/3.1/topics/auth/passwords/