Skip to content

Commit

Permalink
仮会員設定:無効
Browse files Browse the repository at this point in the history
本人認証:無効
二段階認証:有効
パターンの対応。
EC-CUBE#7
  • Loading branch information
sai-gillingham committed Mar 9, 2023
1 parent c942b7a commit 3bde284
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions EventListener/CustomerPersonalValidationListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

Expand Down Expand Up @@ -159,7 +160,11 @@ public function onKernelController(ControllerArgumentsEvent $event)
return;
}

if ($this->baseInfo->isOptionCustomerActivate() && !$this->baseInfo->isOptionActivateDevice()) {
if (
($this->baseInfo->isOptionCustomerActivate() && !$this->baseInfo->isOptionActivateDevice())
||
!$this->baseInfo->isOptionCustomerActivate()
) {
// デバイス認証なし かつ 2段階認証使用しない場合は処理なし
return;
}
Expand All @@ -182,15 +187,16 @@ public function onKernelController(ControllerArgumentsEvent $event)
*
* @param mixed $event
*
* @throws HttpException\NotFoundHttpException
* @throws NotFoundHttpException
*/
private function deviceAuth($event)
{
// アクティベーション
$secret_key = $event->getRequest()->attributes->get('secret_key');

$Customer = $this->customerRepository->getProvisionalCustomerBySecretKey($secret_key);
if (is_null($Customer)) {
throw new HttpException\NotFoundHttpException();
throw new NotFoundHttpException();
}

if ($Customer->isDeviceAuthed()) {
Expand Down

0 comments on commit 3bde284

Please sign in to comment.