PreAuthUserCheckPlugins not executed anymore current demo shop?

tgeo112233
tgeo112233 Posts: 2 🧑🏻‍🚀 - Cadet

Hello,

I'm trying to execute some custom logic to verify customers prior to login. The interface \SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\PreAuthUserCheckPluginInterface seems to be the right fit, and I remember that we enabled a plugin at some point in the project (\SprykerShop\Yves\CompanyPage\Plugin\CustomerPage\CompanyUserPreAuthUserCheckPlugin). This plugin is also active in the current b2b demo shop (202404.0). I'm certain that at some point this was working on project level, however it appears that now the plugin is not executed during customer login. I also tested this with a fresh install of the earlier mentioned version of the b2b demo shop.

Unfortunately I'm not an expert when it comes to symfony/ spryker security bundles. I'm puzzled why this plugin is not executed anymore. Maybe someone with a deeper understanding could help me understand.

Although I can think about some alternative ways to implement the necessary functionality, a dedicated plugin seems to be the most "spryker way" of doing this. Especially since it is still active in the demo shop.

Thanks in advance,

best regards Tom

Tagged:

Best Answer

  • profuel
    profuel Sprykee Posts: 55 🪐 - Explorer
    Answer ✓

    Hi, Tom,

    I'm using the latest B2B demoshop, and this plugin (CompanyUserPreAuthUserCheckPlugin) is still executed on the customer login attempt, specifically method checkPreAuth.

    Could you please set a breakpoint on the 1st line of this method \Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider::authenticate and see if it's triggered?

    Thank you, AndriyT

Answers

  • profuel
    profuel Sprykee Posts: 55 🪐 - Explorer
    Answer ✓

    Hi, Tom,

    I'm using the latest B2B demoshop, and this plugin (CompanyUserPreAuthUserCheckPlugin) is still executed on the customer login attempt, specifically method checkPreAuth.

    Could you please set a breakpoint on the 1st line of this method \Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider::authenticate and see if it's triggered?

    Thank you, AndriyT

  • tgeo112233
    tgeo112233 Posts: 2 🧑🏻‍🚀 - Cadet

    Although I checked this earlier, I rechecked and you're correct. The plugin is indeed executed in the current demo shop. Sorry for the confusion and thanks for the support. I'm sure I can figure out now why it's not working on project level for us.


    Thanks!