Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is validating password confirmation and the password in the backend unnecessary?

I'm thinking if it is necessary to even ask the user to re-enter the password? Anyway if I decide to have the user re-enter the password, is comparing client side good enough and does it pose any security risks, or should I compare server side?

like image 561
sulemani Avatar asked Nov 26 '25 07:11

sulemani


1 Answers

The purpose of typing the password twice is just to catch typos, it serves no security purpose. So checking it in the client should generally be sufficient. If the user disables this somehow, they're just hurting themselves, since they might submit an unintended password.

The only reason you might do it in the server as well is if you want to support users who disable JavaScript in the browser.

like image 141
Barmar Avatar answered Nov 28 '25 22:11

Barmar