dimanche 24 octobre 2021

Csrf token invalid when the user press the back button and sumbit the login form again - Laravel

The problem is when the user are authenticated and for any reason pick the back button of the browser and send the data to the server again. Or some users access directly at the url and try to login (Maybe crsf charged time before or expired) and returns the same error.

Someone knows how can prevent this?

I will show you some pictures:

  1. the user logged in normally enter image description here
  2. The log in redirect to the dashboard normally,

enter image description here

  1. But if the users clicks the back button the browsers shows the login form again and the route mydomain.com/login and if the users click the "Acceder" button the server response me with and error 419 enter image description here

Thanks!




Aucun commentaire:

Enregistrer un commentaire