diff --git a/app/Http/Controllers/StopImpersonationController.php b/app/Http/Controllers/StopImpersonationController.php deleted file mode 100644 index f449805b8..000000000 --- a/app/Http/Controllers/StopImpersonationController.php +++ /dev/null @@ -1,24 +0,0 @@ -impersonating($request)) { - return back(); - } - - $userId = auth()->user()->id; - - $impersonator->stopImpersonating($request, Auth::guard(), User::class); - - return redirect()->to("/nova/resources/users/{$userId}"); - } -} diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 8c81225c0..2452f7055 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -2,7 +2,6 @@ namespace App\Http; -use App\Http\Middleware\AddImpersonateOverlay; use App\Http\Middleware\AdminsOnly; use App\Http\Middleware\ForceJsonResponse; use App\Http\Middleware\HandleReferrer; @@ -29,7 +28,6 @@ class Kernel extends HttpKernel \Illuminate\View\Middleware\ShareErrorsFromSession::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, HandleReferrer::class, - AddImpersonateOverlay::class, ], 'admin' => [ diff --git a/app/Http/Middleware/AddImpersonateOverlay.php b/app/Http/Middleware/AddImpersonateOverlay.php deleted file mode 100644 index 23adc51fd..000000000 --- a/app/Http/Middleware/AddImpersonateOverlay.php +++ /dev/null @@ -1,75 +0,0 @@ -shouldAddOverlay($request, $response)) { - $this->addDialogToResponse($response); - } - - return $response; - } - - protected function shouldAddOverlay(Request $request, $response): bool - { - if (! $this->impersonator->impersonating($request)) { - return false; - } - - if ($response instanceof RedirectResponse) { - return false; - } - - if ($response instanceof BinaryFileResponse) { - return false; - } - - if ($response instanceof StreamedResponse) { - return false; - } - - if ($response instanceof JsonResponse) { - return false; - } - - if ($request->expectsJson()) { - return false; - } - - if (Str::contains($request->path(), 'nova-api')) { - return false; - } - - return true; - } - - protected function addDialogToResponse(Response $response) - { - $content = $response->getContent(); - - $content .= view('impersonate.overlay', [ - 'impersonatingAsUser' => auth()->user(), - ]); - - $response->setContent($content); - } -} diff --git a/resources/views/impersonate/overlay.blade.php b/resources/views/impersonate/overlay.blade.php deleted file mode 100644 index d406b66e3..000000000 --- a/resources/views/impersonate/overlay.blade.php +++ /dev/null @@ -1,54 +0,0 @@ - -
- diff --git a/routes/web.php b/routes/web.php index a5357b35e..66e4c47fd 100644 --- a/routes/web.php +++ b/routes/web.php @@ -28,13 +28,11 @@ use App\Http\Controllers\RedirectDocsDomainController; use App\Http\Controllers\RedirectGitHubAdClickController; use App\Http\Controllers\SeriesController; -use App\Http\Controllers\StopImpersonationController; use App\Http\Controllers\TidBitsSubscriptionController; use App\Http\Controllers\UsesController; use App\Http\Controllers\CoursesController; use App\Http\Controllers\WebhookController; use App\Http\Controllers\WwsdController; -use App\Models\Member; use Illuminate\Support\Facades\Route; Route::permanentRedirect('docs/ray', 'https://myray.app/docs/'); @@ -42,8 +40,6 @@ Route::redirect('/mailcoach/{any}', 'https://spatie.mailcoach.app/{any}')->where('any', '.*'); -Route::get('stop-impersonation', StopImpersonationController::class)->name('stop-impersonation'); - Route::feeds(); Route::redirect('/docs/products/ray', '/docs/ray');