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

Display any Particle.io registration errors #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kh90909
Copy link

@kh90909 kh90909 commented Feb 13, 2016

To date, the code that checked for errors upon attempting to register an
account with Particle.io contained only a TODO placeholder indicating
that any errors should be shown to the user.

This commit displays the contents of err.message in the login_error html
div that is already used to display a login error. Because the contents
of this div are modified, it was necessary to extend the login error
handling code to reset the message if there is a subsequent login error.
I tried modifying this code to also display err.message, as I hoped it
would give more fine grained messages, but it turned out they were not
user friendly (I got "invalid_client" and "invalid_grant". Therefore, I
kept the existing login error string "Invalid email or password".

I don't know the full range of registration error messages that can be
generated, so it's possible that some of these may not be user
friendly. However, for the error I encountered, the message was
appropriate: "Username must be an email address".

I was attempting to register with the username+string@gmail.com address
format that is recommended by GMail for filtering and spam tracking. No
error message was displayed, which led to some head scratching until I
started debugging the code and found this message. It appears
Particle.io does not support this email address format.

To date, the code that checked for errors upon attempting to register an
account with Particle.io contained only a TODO placeholder indicating
that any errors should be shown to the user.

This commit displays the contents of err.message in the login_error html
div that is already used to display a login error. Because the contents
of this div are modified, it was necessary to extend the login error
handling code to reset the message if there is a subsequent login error.
I tried modifying this code to also display err.message, as I hoped it
would give more fine grained messages, but it turned out they were not
user friendly (I got "invalid_client" and "invalid_grant". Therefore, I
kept the existing login error string "Invalid email or password".

I don't know the full range of registration error messages that can be
generated, so it's possible that some of these may not be user
friendly. However, for the error I encountered, the message was
appropriate: "Username must be an email address".

I was attempting to register with the username+string@gmail.com address
format that is recommended by GMail for filtering and spam tracking. No
error message was displayed, which led to some head scratching until I
started debugging the code and found this message. It appears
Particle.io does not support this email address format.
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

Successfully merging this pull request may close these issues.

1 participant