Lock out users after too many failed login attempts

前端 未结 5 1419
一向
一向 2021-01-04 06:57

I\'m looking for the most elegant way to lock a Django user account after several failed login attempts.

\"What have I tried?\":

5条回答
  •  余生分开走
    2021-01-04 07:34

    One simple solution would be to create a variable in the User Profile that is initialy 0 and increased by 1 every time the user unsuccessfully tries to login. If this variable reaches a certain threshold(which is checked every time the user tries to login), the user account can be suspended. Of course when the user does succesfully login, the variable must be set back to 0.

提交回复
热议问题