JosefCevik / JWManagement

GNU Affero General Public License v3.0
57 stars 30 forks source link

Validate email addresses during sign-up #406

Open ssb22 opened 5 years ago

ssb22 commented 5 years ago

One non-technical user saw the box to type her email address and typed:

ok its me@example.com

(address removed obviously). This caused the timesheet to contain, in its HTML,

<a href="mailto:ok its me@example.com">

which is slightly unhelpful. This could be avoided by adding a simple check at sign-up time that the email field does not contain any spaces. (Well, if there is a space at the very beginning or at the very end, we can just strip it without complaining, but if there is a space in the middle then it probably means we are dealing with a non-technical person who doesn't know that an email field really needs to contain the email address only, with no extra words like "ok its".) If you want to retrospectively fix it for this particular user, simply search the database for an email starting "ok its "