I’ve seen lots of login fields that don’t trim the input forms when they test to see if it matches what’s in their database. However, they forget that many people simply copy and paste this information from an email they receive. Depending on how you copy the text from your email, sometimes you will get a linebreak or extra space at the end. Since the password fields are all starred out, you wont even notice the extra space or character at the end and fail to login. I’ve seen other people do this and a few times I’ve had it to me. Because often a site will give you a random password, so it’s easier just to copy and paste it into the login. Trim the username and password fields for the login only, I don’t see any need to do it for registration forms.