0

In Exceptions/Handler.php i added some logic to send an email with every exception from my flow ( i added this to report method ).

In my flow i have severals forms and from time to time i get an email with an error on line 82 in file: Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php . At this line is this "throw new TokenMismatchException ".

After reading some questions & answers i added csrf token to my forms.

The thing is i can't reproduce this error and the exception doesn't have any error code or message.

Beside that, in laravel.log there's no error about csrf.

My questions are:

  1. Is this error flow breaking? I've made the flow several times and i didn't get any error, but if this exception will be throwed when a customer is in the flow, it will break the flow ( i mean it will be redirected to an error page ) or the client will know nothing?

  2. Why this error is not in laravel.log?

  3. Do you have any idea what can i do to fix this error?

Ioan Andrei
  • 93
  • 1
  • 16
  • *flow breaking* what flow? `TokenMismatchException` will be thrown if the csrf cant be validated due to the following invalid for whatever reason: 1) hidden field that store csrf value, 2) the cookies (both cookie for csrf itself and session). afaik – Bagus Tesa Oct 31 '19 at 07:34
  • It is very easy to create the csrf token error. You just have to post a form without a csrf token... – Techno Oct 31 '19 at 13:41
  • Or change the token in the form before posting ofcource if your goal is TokenMismatchException – Techno Oct 31 '19 at 13:43

0 Answers0