Should I trim spaces in a password field

后端 未结 8 690
南旧
南旧 2021-01-01 12:17

Just wondering.

We usually trim a user name in various forms in our ASP.Net application, whats the best practices for password fields.

i.e. should we remove

8条回答
  •  轮回少年
    2021-01-01 12:24

    it depends by your business: if you want allow the users to create passwords with spaces at the end you should not do that. anyway instead of trim it it would be better to validate it and notify the user about an invalid password showing the reason in this case the white spaces

提交回复
热议问题