coasterframework icon indicating copy to clipboard operation
coasterframework copied to clipboard

Handling TokenMismatchException

Open zepco opened this issue 9 years ago • 2 comments

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:

zepco avatar Aug 24 '16 17:08 zepco

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.

chadanuk avatar Aug 25 '16 08:08 chadanuk

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();
}

d3v2a avatar Nov 05 '16 09:11 d3v2a