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

Bad email address in authentication form should display validation errors #16856

Closed
QuincyLarson opened this issue Mar 8, 2018 · 6 comments
Closed
Labels
help wanted Open for all. You do not need permission to work on these. platform: learn UI side of the client application that needs familiarity with React, Gatsby etc.

Comments

@QuincyLarson
Copy link
Contributor

QuincyLarson commented Mar 8, 2018

On the /signin page, if I enter an invalid email address like "test@test" it will crash the app.

sign_in_to_freecodecamp_using_your_email_address___freecodecamp

@raisedadead raisedadead changed the title Bad email address crashes authentication form Bad email address in authentication form should display validation errors Mar 13, 2018
@raisedadead
Copy link
Member

Its actually not crashing the app, and the backend is throwing the error correctly.

fcc:middlewares:error-reporter Email is not a valid email address. +5s
{ Error: Email is not a valid email address.
...
...
{ type: 'errors',
     message: 'Email is not a valid email address.',
     redirectTo: '/email-signup',
     status: 400 } }

I think this needs, investigation to check why the error message isn't displayed as a flash message.

@raisedadead raisedadead added help wanted Open for all. You do not need permission to work on these. platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. labels Mar 13, 2018
@jacobpiec
Copy link

What if you were to give the input part of it the type of "email". Doesn't HTML5 come with a way to ensure that the input is a valid email?

@raisedadead
Copy link
Member

I think its already the case.

@jacobpiec
Copy link

So then wouldn't that be enough of an alert? Or am I missing something

@raisedadead
Copy link
Member

Yes, the issue is its not triggered for some reason. Here is view if you are interested in debugging
https://github.com/freeCodeCamp/freeCodeCamp/blob/staging/server/views/account/email-signin.jade

Reach out to Contributors Chat room for any assistance in contributing.

Thanks.

@raisedadead
Copy link
Member

Hi @Radlerz1 thanks for reporting. Yes indeed.

Just to clarify for future reference:

  1. The native HTML validation is fine, turns out I completely missed the fact the test@test is actually a valid email just like test@localhost
  2. We were not getting the server side validation messages, for a reasons unknown to me. But this has now been resolved in some recent changes merged within the last day.

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Open for all. You do not need permission to work on these. platform: learn UI side of the client application that needs familiarity with React, Gatsby etc.
Projects
None yet
Development

No branches or pull requests

3 participants