Eccube3のバージョン: 3.0.16
Eccube本体のソースは触ってないのですが、
プラグイン側の event.yml で下記のイベントを張り
front.shopping.confirm.initialize: - [onShoppingConfirmInit, NORMAL]
ログインしている状態で、 onShoppingConfirmInit()イベントにて
$app->isGranted('ROLE_USER')
を実行すると、下記例外が発生してしまいます。。。
[2019-04-22 00:00:54,012884] front.ERROR [517d038a] [1cd34d92] [NULL] [LogListener:onKernelException:115] - Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException: The token storage contains no authentication token. One possible reason may be that there is no firewall configured for this URL. (uncaught exception) at /var/www/html/eccube/vendor/symfony/security/Core/Authorization/AuthorizationChecker.php line 57 {"exception":"[object] (Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException(code: 0): The token storage contains no authentication token. One possible reason may be that there is no firewall configured for this URL. at /var/www/html/eccube/vendor/symfony/security/Core/Authorization/AuthorizationChecker.php:57)"} [POST, /shopping/confirm, 192.168.10.20, https://192.168.10.20/shopping, Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36]
symfonyのソースを追っていくと、
vendor/symfony/security/Core/Authorization/AuthorizationChecker.php#isGranted()
$this->tokenStorage->getToken()
で取得したトークンがnullなため起きているようです。
ちなみに、今回は app/config/security.yml は用意してないです。
以前は普通に $app->isGranted('ROLE_USER')
を問題なく実行できていたため、何が起きているかわかってないです。。
何かわかりましたら、よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。