This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
namespace Esun\AiMascotCampaign\Controller\Register;
use Esun\AiMascotCampaign\Model\CampaignContext;
use Magento\Customer\Model\Session as CustomerSession;
use Magento\Framework\App\Action\HttpGetActionInterface;
use Magento\Framework\Controller\Result\Redirect;
use Magento\Framework\Controller\Result\RedirectFactory;
class Start implements HttpGetActionInterface
{
public function __construct(
private readonly CampaignContext $campaignContext,
private readonly CustomerSession $customerSession,
private readonly RedirectFactory $redirectFactory
) {
}
public function execute(): Redirect
{
if ($this->customerSession->isLoggedIn()) {
return $this->redirectFactory->create()->setPath(
'customer/account',
['_secure' => true]
);
}
$this->campaignContext->start();
return $this->redirectFactory->create()->setPath(
'customer/account/create',
['_secure' => true]
);
}
}