Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught exception when login in with an user assigned to a different website in a multi-website setup #3

Open
acampos1916 opened this issue May 9, 2018 · 0 comments

Comments

@acampos1916
Copy link

We have a multi-website Magento 2.2.1 and got this error when login in on website 1 with an user from website 2:

{
	"0": "No such entity with email = angelcampos@adamantio.com.ve, websiteId = 1",
	"1": "#0 /var/www/html/magento2/vendor/magento/module-customer/Model/ResourceModel/CustomerRepository.php(288): Magento\\Customer\\Model\\CustomerRegistry->retrieveByEmail('angelcampos@ada...', '1')\n#1 /var/www/html/magento2/app/code/Amitshree/Customer/Plugin/Customer/Controller/Account/LoginPost.php(95): Magento\\Customer\\Model\\ResourceModel\\CustomerRepository->get('angelcampos@ada...')\n#2 /var/www/html/magento2/app/code/Amitshree/Customer/Plugin/Customer/Controller/Account/LoginPost.php(54): Amitshree\\Customer\\Plugin\\Customer\\Controller\\Account\\LoginPost->getCustomer('angelcampos@ada...')\n#3 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(135): Amitshree\\Customer\\Plugin\\Customer\\Controller\\Account\\LoginPost->aroundExecute(Object(Magento\\Customer\\Controller\\Account\\LoginPost\\Interceptor), Object(Closure))\n#4 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(153): Magento\\Customer\\Controller\\Account\\LoginPost\\Interceptor->Magento\\Framework\\Interception\\{closure}()\n#5 /var/www/html/magento2/generated/code/Magento/Customer/Controller/Account/LoginPost/Interceptor.php(26): Magento\\Customer\\Controller\\Account\\LoginPost\\Interceptor->___callPlugins('execute', Array, Array)\n#6 /var/www/html/magento2/vendor/magento/framework/App/Action/Action.php(107): Magento\\Customer\\Controller\\Account\\LoginPost\\Interceptor->execute()\n#7 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(58): Magento\\Framework\\App\\Action\\Action->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#8 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(138): Magento\\Customer\\Controller\\Account\\LoginPost\\Interceptor->___callParent('dispatch', Array)\n#9 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(153): Magento\\Customer\\Controller\\Account\\LoginPost\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#10 /var/www/html/magento2/generated/code/Magento/Customer/Controller/Account/LoginPost/Interceptor.php(39): Magento\\Customer\\Controller\\Account\\LoginPost\\Interceptor->___callPlugins('dispatch', Array, Array)\n#11 /var/www/html/magento2/vendor/magento/framework/App/FrontController.php(55): Magento\\Customer\\Controller\\Account\\LoginPost\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#12 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(58): Magento\\Framework\\App\\FrontController->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#13 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(138): Magento\\Framework\\App\\FrontController\\Interceptor->___callParent('dispatch', Array)\n#14 /var/www/html/magento2/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#15 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(135): Magento\\Store\\App\\FrontController\\Plugin\\RequestPreprocessor->aroundDispatch(Object(Magento\\Framework\\App\\FrontController\\Interceptor), Object(Closure), Object(Magento\\Framework\\App\\Request\\Http))\n#16 /var/www/html/magento2/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(69): Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#17 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(135): Magento\\PageCache\\Model\\App\\FrontController\\BuiltinPlugin->aroundDispatch(Object(Magento\\Framework\\App\\FrontController\\Interceptor), Object(Closure), Object(Magento\\Framework\\App\\Request\\Http))\n#18 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(153): Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#19 /var/www/html/magento2/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\\Framework\\App\\FrontController\\Interceptor->___callPlugins('dispatch', Array, NULL)\n#20 /var/www/html/magento2/vendor/magento/framework/App/Http.php(135): Magento\\Framework\\App\\FrontController\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#21 /var/www/html/magento2/vendor/magento/framework/App/Bootstrap.php(256): Magento\\Framework\\App\\Http->launch()\n#22 /var/www/html/magento2/pub/index.php(37): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http))\n#23 {main}",
	"url": "/spanish/customer/account/loginPost/referer/aHR0cHM6Ly81NC4xNjYuMjA3LjE2MC9zcGFuaXNoLw%2C%2C/",
	"script_name": "/index.php"
}

Moving the following line inside the try block in LoginPost.php seems to fix the issue:

$customer = $this->getCustomer($login['username']);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant