terminal42 / contao-mailusername

MIT License
7 stars 5 forks source link

Error: Missing form field "_target_path" if send registration module #19

Closed zonky2 closed 4 years ago

zonky2 commented 4 years ago

Contao 4.9.3

I have a page with registration module with the fields username and password - if I fill it out and send it, the error will appear if dev mode on...

The checkbox in root page "Automatisch aktivieren" and "Automatisch anmelden" is checked

Symfony\Component\HttpKernel\Exception\BadRequestHttpException:
Missing form field "_target_path". You probably need to adjust your custom login template.

  at /www/htdocs/123/contao4_xyz/vendor/contao/core-bundle/src/Security/Authentication/AuthenticationSuccessHandler.php:180
  at Contao\CoreBundle\Security\Authentication\AuthenticationSuccessHandler->decodeTargetPath(object(Request))
     (/www/htdocs/123/contao4_xyz/vendor/contao/core-bundle/src/Security/Authentication/AuthenticationSuccessHandler.php:154)
  at Contao\CoreBundle\Security\Authentication\AuthenticationSuccessHandler->determineTargetUrl(object(Request))
     (/www/htdocs/123/contao4_xyz/vendor/contao/core-bundle/src/Security/Authentication/AuthenticationSuccessHandler.php:121)
  at Contao\CoreBundle\Security\Authentication\AuthenticationSuccessHandler->onAuthenticationSuccess(object(Request), object(UsernamePasswordToken))
     (/www/htdocs/123/contao4_xyz/vendor/terminal42/contao-autoregistration/src/EventListener/RegistrationListener.php:188)
  at Terminal42\AutoRegistrationBundle\EventListener\RegistrationListener->loginUser('my.email@example.com')
     (/www/htdocs/123/contao4_xyz/vendor/terminal42/contao-autoregistration/src/EventListener/RegistrationListener.php:126)
  at Terminal42\AutoRegistrationBundle\EventListener\RegistrationListener->onCreateNewUser(8, array('email' => 'my.email@example.com', 'password' => '$argon2id$v=19$m=65536,t=4,p=1$mlzsDe6mozLYVEFtD98pbw$H7TuCJx0OkBChiGXCDFaZxi7bq6I6+rOqi8v0AkCfCg', 'tstamp' => 1591187598, 'login' => '1', 'dateAdded' => 1591187598, 'groups' => 'a:1:{i:0;s:1:"1";}', 'disable' => 1, 'id' => '8', 'username' => 'my.email@example.com'), object(ModuleRegistration))
     (/www/htdocs/123/contao4_xyz/vendor/contao/core-bundle/src/Resources/contao/modules/ModuleRegistration.php:432)
  at Contao\ModuleRegistration->createNewUser(array('email' => 'my.email@example.com', 'password' => '$argon2id$v=19$m=65536,t=4,p=1$mlzsDe6mozLYVEFtD98pbw$H7TuCJx0OkBChiGXCDFaZxi7bq6I6+rOqi8v0AkCfCg', 'tstamp' => 1591187598, 'login' => '1', 'dateAdded' => 1591187598, 'groups' => 'a:1:{i:0;s:1:"1";}', 'disable' => 1, 'id' => '8', 'username' => 'my.email@example.com'))
     (/www/htdocs/123/contao4_xyz/vendor/contao/core-bundle/src/Resources/contao/modules/ModuleRegistration.php:331)
  at Contao\ModuleRegistration->compile()
     (/www/htdocs/123/contao4_xyz/vendor/contao/core-bundle/src/Resources/contao/modules/Module.php:209)
  at Contao\Module->generate()
     (/www/htdocs/123/contao4_xyz/vendor/contao/core-bundle/src/Resources/contao/modules/ModuleRegistration.php:56)
  at Contao\ModuleRegistration->generate()
     (/www/htdocs/123/contao4_xyz/vendor/contao/core-bundle/src/Resources/contao/library/Contao/Controller.php:414)
  at Contao\Controller::getFrontendModule('6')
     (/www/htdocs/123/contao4_xyz/vendor/contao/core-bundle/src/Resources/contao/library/Contao/InsertTags.php:512)
  at Contao\InsertTags->doReplace('<!-- TEMPLATE START: vendor/contao-bootstrap/layout/src/Resources/contao/templates/fe_bootstrap.html5 --><!DOCTYPE html><html lang="de"><head>      <meta charset="utf-8">    <title>Zur Kasse - Business-Agility-Coach</title>    <base href="http://business-agility-coach.com.w01aa078.kasserver.com/">          <meta name="robots" content="index,follow">      <meta name="description" content="">      <meta name="generator" content="Contao Open Source CMS">      <meta http-equiv="x-ua-compatible" content="ie=edge">        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">        [[TL_CSS]]        [[TL_HEAD]]      </head><body id="top" class="win firefox gecko fx76" itemscope itemtype="http://schema.org/WebPage">          <div id="wrapper">                        <header id="header" itemscope itemtype="http://schema.org/WPHeader">            <div class="inside">              <!-- TEMPLATE START: vendor/contao/core-bundle/src/Resources/contao/templates/modules/mod_navigation.html5 --><!-- indexer::stop --><nav class="mod_navigation block" itemscope itemtype="http://schema.org/SiteNavigationElement">    <a href="zur-kasse.html#skipNavigation17" class="sr-only">Navigation überspringen</a>  <!-- TEMPLATE START: vendor/contao/core-bundle/src/Resources/contao/templates/navigation/nav_default.html5 --><ul class="level_1">            <li class="sibling first"><a href="./" title="Home" class="sibling first" itemprop="url"><span itemprop="name">Home</span></a></li>                <li class="sibling"><a href="open-exam.html" title="Open Exam" class="sibling" itemprop="url"><span itemprop="name">Open Exam</span></a></li>                <li class="sibling"><a href="bac-certification.html" title="BAC Certification" class="sibling" itemprop="url"><span itemprop="name">BAC Certification</span></a></li>                <li class="sibling last"><a href="mein-konto.html" title="Mein Konto" class="sibling last" itemprop="url"><span itemprop="name">Mein Konto</span></a></li>      </ul><!-- TEMPLATE END: vendor/contao/core-bundle/src/Resources/contao/templates/navigation/nav_default.html5 -->  <a id="skipNavigation17" class="sr-only">&nbsp;</a></nav><!-- indexer::continue --><!-- TEMPLATE END: vendor/contao/core-bundle/src/Resources/contao/templates/modules/mod_navigation.html5 -->            </div>          </header>                                  <div class="container" id="container">          <div class="row">                      <main id="main" itemscope itemtype="http://schema.org/WebPageElement" itemprop="mainContentOfPage">              <div class="inside">                <!-- TEMPLATE START: vendor/contao/core-bundle/src/Resources/contao/templates/modules/mod_article.html5 -->  <div class="mod_article first last block" id="article-12">              <!-- TEMPLATE START: vendor/heimrichhannot/contao-loginredirects-bundle/src/Resources/contao/templates/ce_loginRedirects.html5 --><!-- TEMPLATE END: vendor/heimrichhannot/contao-loginredirects-bundle/src/Resources/contao/templates/ce_loginRedirects.html5 --><!-- TEMPLATE START: vendor/contao/core-bundle/src/Resources/contao/templates/elements/ce_text.html5 --><div class="ce_text block">            <h2>Einkaufen als "Gast"</h2>              <p>Möchten Sie einkaufen ohne ein Kundenkonto? - dann klicken Sie auf den Button "Zur Kasse als Gast".</p><p><a class="button" title="Zur Kasse als Gast" href="zur-kasse/kasse.html">Zur Kasse als Gast</a></p>      </div><!-- TEMPLATE END: vendor/contao/core-bundle/src/Resources/contao/templates/elements/ce_text.html5 --><!-- TEMPLATE START: vendor/contao/core-bundle/src/Resources/contao/templates/elements/ce_text.html5 --><div class="ce_text block">            <h2>Einkaufen als "Kunde"</h2>              <p><strong>Registrieren Sie sich als "Kunde" um in Ihre Bestellhistorie und den aktuellen Status Ihrer Bestellung einsehen zu können.</strong></p><p>', true)
     (/www/htdocs/123/contao4_xyz/vendor/contao/core-bundle/src/Resources/contao/library/Contao/InsertTags.php:53)
  at Contao\InsertTags->replace('<!-- TEMPLATE START: vendor/contao-bootstrap/layout/src/Resources/contao/templates/fe_bootstrap.html5 --><!DOCTYPE html><html lang="de"><head>      <meta charset="utf-8">    <title>Zur Kasse</title>

.....

 </body></html><!-- TEMPLATE END: vendor/contao-bootstrap/layout/src/Resources/contao/templates/fe_bootstrap.html5 -->')
     (/www/htdocs/123/contao4_xyz/vendor/contao/core-bundle/src/Resources/contao/classes/FrontendTemplate.php:128)
  at Contao\FrontendTemplate->compile()
     (/www/htdocs/123/contao4_xyz/vendor/contao/core-bundle/src/Resources/contao/library/Contao/Template.php:319)
  at Contao\Template->getResponse()
     (/www/htdocs/123/contao4_xyz/vendor/contao/core-bundle/src/Resources/contao/classes/FrontendTemplate.php:86)
  at Contao\FrontendTemplate->getResponse(true)
     (/www/htdocs/123/contao4_xyz/vendor/contao/core-bundle/src/Resources/contao/pages/PageRegular.php:50)
  at Contao\PageRegular->getResponse(object(PageModel), true)
     (/www/htdocs/123/contao4_xyz/vendor/contao/core-bundle/src/Resources/contao/controllers/FrontendIndex.php:339)
  at Contao\FrontendIndex->renderPage(object(PageModel))
     (/www/htdocs/123/contao4_xyz/vendor/symfony/http-kernel/HttpKernel.php:158)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (/www/htdocs/123/contao4_xyz/vendor/symfony/http-kernel/HttpKernel.php:80)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (/www/htdocs/123/contao4_xyz/vendor/symfony/http-kernel/Kernel.php:201)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (/www/htdocs/123/contao4_xyz/web/index.php:31)   
richardhj commented 4 years ago

Fixed via terminal42/contao-autoregistration#7.

zonky2 commented 4 years ago

thx