1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 12:42:36 +01:00

Added warning for token mismatch error

This commit is contained in:
Hillel Coren 2015-12-13 23:22:06 +02:00
parent 19d5d49e63
commit 5547f222e1
2 changed files with 9 additions and 1 deletions

View File

@ -46,6 +46,14 @@ class Handler extends ExceptionHandler {
{
if ($e instanceof ModelNotFoundException) {
return Redirect::to('/');
} elseif ($e instanceof \Illuminate\Session\TokenMismatchException) {
// https://gist.github.com/jrmadsen67/bd0f9ad0ef1ed6bb594e
return redirect()
->back()
->withInput($request->except('password', '_token'))
->with([
'warning' => trans('texts.token_expired')
]);
}
// In production, except for maintenance mode, we'll show a custom error screen

View File

@ -975,6 +975,6 @@ return array(
'custom_invoice_charges_helps' => 'Add a text input to the invoice create/edit page and include the charge in the invoice subtotals.',
'color_help' => 'Note: the primary color is also used in the client portal and custom email designs.',
'token_expired' => 'Validation token was expired. Please try again.',
);