Strip trailing spaces from login email

Mobile keyboards tend to add spaces when auto-completing words. We don’t strip trailing spaces from email addresses on the login screen. I’ve had users trying to log in on mobile run into this, it returns "no account matches xyz@mail.com", for an account that does exist.

They are stripped from the invite form already. We should strip them on login too.

5개의 좋아요

Agreed @techapj can you take this? Anywhere the user can input data on signup (or login) we should be stripping leading and trailing spaces either during or prior to submission.

3개의 좋아요

I’m forever copying email addresses in some manner that has a leading space.. will be glad to see this managed!

1개의 좋아요

We does strip the the leading/trailing spaces from username/email via:

I am not able to repro the issue (on Desktop/Mobile) where leading/trailing spaces causes login error.

2개의 좋아요

Is this true for password reset form as well, though?

3개의 좋아요

Good catch! Not true in case of password reset, fixing now.

(Sign up form strips whitespace, checked earlier)

4개의 좋아요

Fixed via:

https://github.com/discourse/discourse/commit/335e79777659f543d02d7f027b033b966d3bc866

OOPS: trip trim :blush:

6개의 좋아요