coasterframework
coasterframework copied to clipboard
Handling TokenMismatchException
Go to admin/login or other form and wait about 2 hours and try to submit. You'll see error: TokenMismatchException in VerifyCsrfToken.php line 67:
Hi @zepco...
This is really down to Laravel's framework (see https://laracasts.com/discuss/channels/general-discussion/crsf-checked-before-auth) and the generation of the CSRF token which is a security feature we wouldn't want to remove.
However, I think a nicer error would be a good idea so we'll keep this open as we think of the best way to report this 'feature' to the user.
it would be palced in handler of coaster cms in the render function
if ($e instanceof TokenMismatchException) {
// do something to notify user
$request->flash();
return back();
}