Skip to content

Commit

Permalink
Second impersonation keep OG user intact
Browse files Browse the repository at this point in the history
When you impersonate someone else while already impersonating, system thinks the first impersonated user was the original user. This change fixes that.
  • Loading branch information
daftspunk committed Nov 22, 2017
1 parent 1f1c4f7 commit d33dd0c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Auth/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,9 @@ public function impersonate($user)

$this->login($user, false);

Session::put($this->sessionKey.'_impersonate', $oldSession);
if (!$this->isImpersonator()) {
Session::put($this->sessionKey.'_impersonate', $oldSession);
}
}

public function stopImpersonate()
Expand Down

0 comments on commit d33dd0c

Please sign in to comment.