From aaa4c82d2e2e0a4d89dc47b6a84031a48157ed0d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 5 Apr 2023 13:13:01 +1000 Subject: [PATCH] Add graceful way to handle cut/paste react links --- routes/client.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/routes/client.php b/routes/client.php index 19b0dcd2acc1..0af6e33829f0 100644 --- a/routes/client.php +++ b/routes/client.php @@ -1,5 +1,7 @@ ['invite_db'], 'prefix' => 'client', 'as' => 'clie Route::get('phantom/{entity}/{invitation_key}', [Phantom::class, 'displayInvitation'])->middleware(['invite_db', 'phantom_secret'])->name('phantom_view'); -Route::fallback([BaseController::class, 'notFoundClient']); +Route::fallback(function () { + + if (Ninja::isSelfHost() && Account::first()->set_react_as_default_ap) { + + $account = Account::first(); + + return response()->view('react.index', [ + 'rc' => request()->input('rc', ''), + 'login' => request()->input('login', ''), + 'signup' => request()->input('signup', ''), + 'report_errors' => $account->report_errors, + 'user_agent' => request()->server('HTTP_USER_AGENT'), + ])->header('X-Frame-Options', 'SAMEORIGIN', false); + } + + abort(404); + +});