diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index ba656f6c0131..9d17fb099057 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -47,13 +47,16 @@ 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') - ]); + // prevent loop since the page auto-submits + if ($request->path() != 'get_started') { + // 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