Skip to content

Commit 06be826

Browse files
authored
Merge pull request #16 from YouweGit/feature/set-before-2fa-url
set before auth url
2 parents eb54132 + e166372 commit 06be826

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Plugin/AccountRedirectPlugin.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,19 @@ public function __construct(private readonly CustomerSession $customerSession)
1313
{
1414
}
1515

16+
public function beforeGetRedirect(Redirect $subject): array
17+
{
18+
$beforeAuthUrl = $this->session->getBeforeAuthUrl(false);
19+
if ($beforeAuthUrl) {
20+
$this->customerSession->setBefore2faUrl($beforeAuthUrl);
21+
}
22+
23+
return [];
24+
}
25+
1626
public function afterGetRedirectCookie(Redirect $subject, ?string $result): ?string
1727
{
18-
if ($result && !$this->customerSession->getBefore2faUrl(false)) {
28+
if ($result) {
1929
$this->customerSession->setBefore2faUrl($result);
2030
}
2131

Plugin/LoginPostPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(
3131
public function afterExecute(LoginPost $subject, Redirect $result): Redirect
3232
{
3333
if (!$this->config->isEnabled()) {
34-
return $this;
34+
return $result;
3535
}
3636

3737
if ($this->customerSession->get2faSuccessful()) {

0 commit comments

Comments
 (0)