If I try to register with just email and Password1/2 I get caught in graphql_jwt : token_auth username = kwargs.get(get_user_model().USERNAME_FIELD), where kwargs doesn't contain my username. On our custom user model we're just assigning a uuid to username. Do you have any recommendations as to how to work around this? Some people recommend USERNAME_FIELD = 'email'. The script continues, delivers the authentication email, then returns, generic GraphQLLocatedError.
def save(self, *args, **kwargs):
if not getattr(self, self.USERNAME_FIELD, None):
setattr(self, self.USERNAME_FIELD, uuid.uuid4().hex)
super().save(*args, **kwargs)
File "/Users//.virtualenvs/.../lib/python3.8/site-packages/graphql_auth/mixins.py", line 123, in resolve_mutation
payload = cls.login_on_register(
File "/Users//.virtualenvs/.../lib/python3.8/site-packages/graphql_jwt/decorators.py", line 110, in wrapper
result = f(cls, root, info, **kwargs)
File "/Users//.virtualenvs/.../lib/python3.8/site-packages/graphql_jwt/decorators.py", line 90, in wrapper
raise exceptions.JSONWebTokenError(
graphql.error.located_error.GraphQLLocatedError: Please, enter valid credentials
If I try to register with just email and Password1/2 I get caught in graphql_jwt : token_auth
username = kwargs.get(get_user_model().USERNAME_FIELD)
, where kwargs doesn't contain my username. On our custom user model we're just assigning a uuid to username. Do you have any recommendations as to how to work around this? Some people recommendUSERNAME_FIELD = 'email'
. The script continues, delivers the authentication email, then returns, generic GraphQLLocatedError.