I have a Laravel site and have a login form.

I'm wondering if there is a way to deactivate the form when the user sign-in fail 5x times.
Is there a way to acheive that via Javascript Front-End ?
Back-End Logics
I know that I can achive that via PHP. I keep a track of loginFailCount base on email, in my session, and if it == 5, deactivate the submit button for 1 hr.
Example
- email : john@doe.com
- loginFailCount : 5
- lockAt : 1523 (3:23 PM)
If the current time is 1623, I will enable the login button for john@doe.com again.
If I would have do it via backend, is my thought process, correct ?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire