Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email didnt validate upon registration when it's empty #39

Closed
sirb0rab0g1 opened this issue May 8, 2020 · 1 comment
Closed

Email didnt validate upon registration when it's empty #39

sirb0rab0g1 opened this issue May 8, 2020 · 1 comment
Labels
invalid This doesn't seem right

Comments

@sirb0rab0g1
Copy link

sirb0rab0g1 commented May 8, 2020

settings.py
GRAPHQL_AUTH = {
'LOGIN_ALLOWED_FIELDS': ['email', 'username'],
'ALLOW_LOGIN_NOT_VERIFIED': False,
'REGISTER_MUTATION_FIELDS': ['email', 'username', 'first_name', 'last_name'],
'UPDATE_MUTATION_FIELDS': ['first_name', 'last_name']
# ...
}

#registration
mutation { register( email: "", username: "as", password1: "Pasmo.123", password2: "Pasmo.123", first_name: "wawex", last_name: "wawex" ) { success, errors, # token } }
#response
{ "data": { "register": { "success": true, "errors": null } } }

@sirb0rab0g1 sirb0rab0g1 changed the title Email didnt validate upon registration Email didnt validate upon registration when it's empty May 8, 2020
@PedroBern
Copy link
Owner

PedroBern commented May 8, 2020

This is the expected behavior with the default user model. The email did validate.

If you want the email to be required, create a custom user model with the following:

email = models.EmailField(blank=False ...

@PedroBern PedroBern added the invalid This doesn't seem right label May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants