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

Emails and passwords are not being validated on the server side #169

Open
jedwards1211 opened this issue Jul 20, 2016 · 0 comments
Open

Comments

@jedwards1211
Copy link
Contributor

This is related to #168.
I thought they were being validated by GraphQLEmailType and GraphQLPasswordType's parseLiteral, but this is actually not the case because the email and password are provided as parameterized query variables, which only go through parseValue.

For instance if I sign up with email "a" and password "a" with curl:
> curl -H "Content-Type: application/json" -X POST -d '{"query": "mutation($email: Email!, $password: Password!) { payload: createUser(email: $email, password: $password) { authToken } }", "variables": {"email": "a", "password": "a"} }' http://localhost:3000/graphql

It succeeds:
{"data":{"payload":{"authToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjcwYmMyNTUxLTgzZDYtNDYxOC04ZWMzLTEyYjYzYTFhMTQ0MSIsImlhdCI6MTQ2OTAzMTEyOSwiZXhwIjoxNDY5NjM1OTI5fQ.cS5Zla5DIo4z_HOKGUVHnu0lrqVk4yoEDFsFRWYXc-0"}}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant