I'm just getting started with web development and I'm working on a project where users can sign up and log in. I'm unsure if I should let users include spaces in their passwords or if I should block them. What do you think?
5 Answers
Most people are saying you should allow every character in passwords, unless there’s some technical issue (which is rare). Just remember, never store passwords in plain text. They should always be hashed to keep them secure. Also, don’t limit password length unless it’s necessary for your database. It’s better to let users create strong passwords with spaces if they want!
And double-check your hashing method is secure—using something like bcrypt is a solid choice!
Let users pick their passwords—including spaces, emojis, or symbols! The main thing is how you handle the passwords on the backend. They should be hashed and salted before any saving.
Allowing spaces can actually enhance password strength. Really, you shouldn’t be worried about blank spaces as long as users can reset forgotten passwords. Heck, if someone wants to use a hard-to-type password with spaces, that's their choice! Just ensure you're hashing everything properly.
I think it's perfectly fine to allow spaces. A lot of people like using passphrases, which can be easier to remember. If users occasionally make mistakes with leading or trailing spaces, maybe you could trim those off to prevent issues. But overall, let them choose their passwords freely!
Totally agree with you! Passphrases are often more secure and easier to recall than complex passwords.
Just enable spaces, and don’t mess with user inputs too much. If people need to reset their passwords later, they can handle that!
Spaces in passwords might complicate things for some users, but as long as they can reset it easily, there’s no need to restrict them. It's all about giving users options without making things unnecessarily complicated!
Exactly! Just make sure to use a good hash function, so even if your database is compromised, the actual passwords won't be leaked.