Skip to content

Commit

Permalink
[5.x] Prevent user from being logged out when ending impersonation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean authored Sep 9, 2024
1 parent 443a27d commit 42f43ca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Http/Controllers/CP/Auth/ImpersonationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
use Illuminate\Support\Facades\Auth;
use Statamic\Events\ImpersonationEnded;
use Statamic\Facades\User;
use Statamic\Http\Controllers\Controller;
use Statamic\Http\Middleware\CP\AuthenticateSession;

class ImpersonationController
class ImpersonationController extends Controller
{
public function __construct()
{
$this->middleware(AuthenticateSession::class);
}

public function stop()
{
if ($originalUserId = session()->pull('statamic_impersonated_by')) {
Expand Down

0 comments on commit 42f43ca

Please sign in to comment.