Magento API REST customer not redirecting to Authentication Page

后端 未结 4 586
南方客
南方客 2021-01-16 05:30

I am trying to access products through Customer account. To achieve this I am using sample code from oauth_customer.php magento documentation page.
Everything i

4条回答
  •  执笔经年
    2021-01-16 06:07

    As bas_van_poppel said, by adding the form key to the appropiate phtml, you get rid of the redirect to the regular login page.

    In order to avoid the redirection to the dashboard page and get redirected to your app, you need to remove the call to setAfterAuthUrl in the _initForm method on app/code/core/Mage/Oauth/controllers/AuthorizeController.php:

        /** @var $helper Mage_Core_Helper_Url */
        $helper = Mage::helper('core/url');
        $session // We don't want this: ->setAfterAuthUrl(Mage::getUrl('customer/account/login', array('_nosid' => true)))
                ->setBeforeAuthUrl($helper->getCurrentUrl());
    

    After a successful login, Magento redirects the customer to the after_auth_url value in the customer session, if the value is not specified, it will redirect you to the value of before_auth_url.

    This is just for illustrative purposes, you should follow best practices to override this core controller.

提交回复
热议问题