Skip to content

Commit dbd9a68

Browse files
authored
Merge pull request #17245 from craftcms/bugfix/impersonation-and-elevated-session-without-2sv
complete login with user we're impersonating
2 parents 57d532b + bb5aece commit dbd9a68

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- Fixed a bug where Money field condition rules weren’t working within field layouts. ([#17236](https://github.com/craftcms/cms/issues/17236))
1010
- Fixed a bug where some custom field inputs weren’t getting initialized properly after being lazily-shown via a field layout condition. ([#17239](https://github.com/craftcms/cms/issues/17239))
1111
- Fixed an error that could occur when attempting to edit a newly-created nested entry within a Matrix field set to the element index view mode. ([#17231](https://github.com/craftcms/cms/pull/17231))
12+
- Fixed a bug where setting up two-step verification for an impersonated user would result in the original user getting logged back in. ([#17245](https://github.com/craftcms/cms/pull/17245))
1213
- Fixed styling issues. ([#17237](https://github.com/craftcms/cms/issues/17237))
1314

1415
## 5.7.5 - 2025-05-06

src/controllers/UsersController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public function actionLogin(): ?Response
275275
// if we're impersonating, pass the user we're impersonating to the complete method
276276
$impersonator = $userSession->getImpersonator();
277277
if ($impersonator !== null) {
278-
$user = $impersonator;
278+
$user = Craft::$app->getUser()->getIdentity();
279279
}
280280

281281
return $this->_completeLogin($user, $duration);

0 commit comments

Comments
 (0)