# Automatischer Kundenlogin nach Registrierung

**URL:** <https://forum.shopware.com/t/automatischer-kundenlogin-nach-registrierung/54145>\
**Category:** Programmierung\
**Created:** [18. Juli 2018 um 10:02 UTC](https://forum.shopware.com/t/automatischer-kundenlogin-nach-registrierung/54145 "2018-07-18T10:02:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SieOtto](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@SieOtto](https://forum.shopware.com/u/SieOtto)\
**Post date:** [18. Juli 2018 um 10:02 UTC](https://forum.shopware.com/t/automatischer-kundenlogin-nach-registrierung/54145/1 "2018-07-18T10:02:58Z")

</div>

```
public function onSaveRegisterSuccessful(Enlight_Event_EventArgs $args)
{
    $userId = $args->getId();
    $CustomerCustomerRepo = Shopware()->Models()->getRepository('Shopware\Models\Customer\Customer')->findOneBy(array('id' => $userId));
    $CustomerCustomerRepo->setInternalComment($CustomerCustomerRepo->getInternalComment() . "KD_NEW_" . $userId . "\n");		
    Shopware()->Models()->persist($CustomerCustomerRepo);
    Shopware()->Models()->flush();
}

```

hallo Community,

ich hab mich auf das Event&nbsp;Shopware\_Modules\_Admin\_SaveRegister\_Successful gehangen.

und trage hier lediglich einen Wert in die DB ein.

Mein Problem:

Der User wird nach der Registrierung nicht automatisch eingeloggt.

Kommentiere ich die Funktion aus, ist er automatisch nach der Registrierung drin.

---

<div class="post-metadata">

**Author:** ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)\
**Post date:** [18. Juli 2018 um 10:08 UTC](https://forum.shopware.com/t/automatischer-kundenlogin-nach-registrierung/54145/2 "2018-07-18T10:08:03Z")

</div>

mal ganz einfach ein „return true;“ reingepackt?

---

<div class="post-metadata">

**Author:** ![SieOtto](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@SieOtto](https://forum.shopware.com/u/SieOtto)\
**Post date:** [25. Juli 2018 um 12:27 UTC](https://forum.shopware.com/t/automatischer-kundenlogin-nach-registrierung/54145/3 "2018-07-25T12:27:52Z")

</div>

Ja, ändert sich leider nichts
