Login.Register autoLogin and postHooks not working together

Hello,

I am using the Login.Register extra for my website’s registration page, and there seems to be a conflict between the autoLogin parameter and the postHooks parameter. When I have the autoLogin parameter included in the register tag but not postHooks, I am automatically logged into the new account that i’ve created, as expected, but when I include the postHooks parameter with a snippet that sends the admin an email, the email gets sent upon submitting the form, but I am not automatically logged in. Is there an issue with using these two parameters in the same login tag, and if there is, is there any way to make it so that the post hook can fire and the new user can automatically get logged in upon form submission?

Here is an example of the register tag that I am using and its parameters:

[[!Register?
&activation='0'
&autoLogin='1'
&submitVar='****'
&submittedResourceId='***'
&usergroups='*'
&persistParams='1'
&placeholderPrefix='reg.'
&redirectUnsetDefaultParams='1'
&postHooks='emailPostHook'
]]

It seems that this is the same bug as described here:

The code tries to read the username for the autoLogin in this line here:

But $this->user is now an array instead of an object.

Also, what version of MODX (and Login) are you using?

I think there was a bug (that caused this behavior) in earlier versions of MODX 3. But that should be fixed in MODX version 3.0.3-pl.

Thank you for the quick response! I have already set redirectUnsetDefaultParams to 1, but I am still having issues with the autoLogin working. I am using MODX version 3.0.1. Should upgrading to the latest version fix this issue?

Yes I believe it will.