OpenMage / magento-lts

Official OpenMage LTS codebase | Migrate easily from Magento Community Edition in minutes! Download the source code for free or contribute to OpenMage LTS | Security vulnerability patches, bug fixes, performance improvements and more.
https://www.openmage.org
Open Software License 3.0
870 stars 436 forks source link

Admin Login succeeds but shows error "invalid form key" #3664

Open alexh-swdev opened 12 months ago

alexh-swdev commented 12 months ago

Preconditions (*)

  1. OM 20.1.0 and still in OM 20.2.0
  2. PHP 8.1
  3. backend renamed from the default to, e.g. "workspace"
  4. Using "sales" as entrypoint instead of the dashbaord (or whatever is the default)
  5. Using the openmage admin theme

Steps to reproduce (*)

  1. Go to the admin
  2. Login

Expected result (*)

  1. Login completes without any error messages

Actual result (*)

  1. Login is successful (meaning the backend is showing up and one can work as expected)
  2. Error message "invalid formkey" (twice) comes up directly after login grafik

The log is empty, I put some output via var_export() to the log for the login process:

2023-11-19T13:54:34+00:00 ERR (3): Mage_Core_Controller_Varien_Action::_validateFormKey: formkey: EHKCL7TOyhs9v0YL, expected: oPjQzFNAKvcLQQ1Z
2023-11-19T13:54:34+00:00 ERR (3): Mage_Core_Controller_Varien_Action::_validateFormKey: request: Mage_Core_Controller_Request_Http::__set_state(array(
   '_dispatched' => false,
   '_module' => 'workspace',
   '_moduleKey' => 'module',
   '_controller' => 'index',
   '_controllerKey' => 'controller',
   '_action' => 'login',
   '_actionKey' => 'action',
   '_params' => 
  array (
    'key' => '814c5d9d7336582336dabb49b79f1193',
    'messageSent' => true,
    'forwarded' => true,
  ),
   '_paramSources' => 
  array (
    0 => '_GET',
    1 => '_POST',
  ),
   '_requestUri' => '/index.php/workspace/index/index/key/814c5d9d7336582336dabb49b79f1193/',
   '_baseUrl' => '/index.php',
   '_basePath' => '',
   '_pathInfo' => '/workspace/index/index/key/814c5d9d7336582336dabb49b79f1193/',
   '_rawBody' => NULL,
   '_aliases' => 
  array (
  ),
   '_originalPathInfo' => '/workspace/index/index/key/814c5d9d7336582336dabb49b79f1193/',
   '_storeCode' => NULL,
   '_requestString' => '/workspace/index/index/key/814c5d9d7336582336dabb49b79f1193/',
   '_rewritedPathInfo' => NULL,
   '_requestedRouteName' => NULL,
   '_routingInfo' => 
  array (
  ),
   '_route' => 'adminhtml',
   '_directFrontNames' => 
  array (
    'api' => '',
  ),
   '_controllerModule' => 'Mage_Adminhtml',
   '_isStraight' => false,
   '_beforeForwardInfo' => 
  array (
  ),
   '_internallyForwarded' => true,
))
2023-11-19T13:54:34+00:00 ERR (3): Mage_Core_Controller_Varien_Action::_validateFormKey: formkey: EHKCL7TOyhs9v0YL, expected: oPjQzFNAKvcLQQ1Z
2023-11-19T13:54:34+00:00 ERR (3): Mage_Core_Controller_Varien_Action::_validateFormKey: request: Mage_Core_Controller_Request_Http::__set_state(array(
   '_dispatched' => true,
   '_module' => 'workspace',
   '_moduleKey' => 'module',
   '_controller' => 'index',
   '_controllerKey' => 'controller',
   '_action' => 'login',
   '_actionKey' => 'action',
   '_params' => 
  array (
    'key' => '814c5d9d7336582336dabb49b79f1193',
    'messageSent' => true,
    'forwarded' => true,
  ),
   '_paramSources' => 
  array (
    0 => '_GET',
    1 => '_POST',
  ),
   '_requestUri' => '/index.php/workspace/index/index/key/814c5d9d7336582336dabb49b79f1193/',
   '_baseUrl' => '/index.php',
   '_basePath' => '',
   '_pathInfo' => '/workspace/index/index/key/814c5d9d7336582336dabb49b79f1193/',
   '_rawBody' => NULL,
   '_aliases' => 
  array (
  ),
   '_originalPathInfo' => '/workspace/index/index/key/814c5d9d7336582336dabb49b79f1193/',
   '_storeCode' => NULL,
   '_requestString' => '/workspace/index/index/key/814c5d9d7336582336dabb49b79f1193/',
   '_rewritedPathInfo' => NULL,
   '_requestedRouteName' => NULL,
   '_routingInfo' => 
  array (
  ),
   '_route' => 'adminhtml',
   '_directFrontNames' => 
  array (
    'api' => '',
  ),
   '_controllerModule' => 'Mage_Adminhtml',
   '_isStraight' => false,
   '_beforeForwardInfo' => 
  array (
  ),
   '_internallyForwarded' => true,
))
codephunk commented 7 months ago

I got exactly the same problem. Login works but this error message shows up twice every time.

ioweb-gr commented 7 months ago

Same here :( image