<![CDATA[ Login and RecaptchaV2 - Logout not possible - My Forums]]> https://forums.modx.com/thread/?thread=103963 <![CDATA[Login and RecaptchaV2 - Logout not possible]]> https://forums.modx.com/thread/103963/login-and-recaptchav2---logout-not-possible#dis-post-559121
I'm using MODX Revolution 2.6.4-pl and the Login Snippet in combination with the RecaptchaV2 snippet. The Login-Chunk is in right sidebar and always visible.

After activation of the recaptcha it's not possible to logout. I'm getting always this error: Please select the checkbox in the ReCaptcha image.

If I delete the &preHooks Parameter in the snippet call, the I can logout.

What could be wrong?

Best regards
Andre]]>
al5040 Jun 17, 2018, 06:07 PM https://forums.modx.com/thread/103963/login-and-recaptchav2---logout-not-possible#dis-post-559121
<![CDATA[Re: Login and RecaptchaV2 - Logout not possible]]> https://forums.modx.com/thread/103963/login-and-recaptchav2---logout-not-possible#dis-post-559161
]]>
BobRay Jun 21, 2018, 05:15 AM https://forums.modx.com/thread/103963/login-and-recaptchav2---logout-not-possible#dis-post-559161
<![CDATA[Re: Login and RecaptchaV2 - Logout not possible]]> https://forums.modx.com/thread/103963/login-and-recaptchav2---logout-not-possible#dis-post-559156
thanks a lot for your help.

I followed your suggestion and created two separate chunks. Together with the Personalize snippet it works as expected. Log out is possible.

Best regards
Andre




]]>
al5040 Jun 20, 2018, 05:51 PM https://forums.modx.com/thread/103963/login-and-recaptchav2---logout-not-possible#dis-post-559156
<![CDATA[Re: Login and RecaptchaV2 - Logout not possible (Best Answer)]]> https://forums.modx.com/thread/103963/login-and-recaptchav2---logout-not-possible#dis-post-559144
Also, double-check to make sure the user has logout permission.

Some possible solutions if the problem persists.

1. Create two versions of the the Login snippet tag, one with the preHook and one without it. Put them in separate chunks and use the Personalize snippet to show the appropriate one. IOW, show the one without the preHook to logged-in users.

2. Make the logout link point to a page with just the login snippet tag, but without the preHook. To do that, change the &logoutResourceId to that page's ID.

[update] The old recaptcha hook doesn't do any checks if the user is logged in, I've suggested that the ReCaptchaV2 snippet do the same.
]]>
BobRay Jun 20, 2018, 03:09 AM https://forums.modx.com/thread/103963/login-and-recaptchav2---logout-not-possible#dis-post-559144
<![CDATA[Re: Login and RecaptchaV2 - Logout not possible]]> https://forums.modx.com/thread/103963/login-and-recaptchav2---logout-not-possible#dis-post-559131
thanks for your reply.

In my logoutTpl chunk is no Recaptcha code.
For testing I tried the original lgnLogoutTpl chunk which is like this:

<div class="loginMessage">[[+errors]]</div>
<br />
<div class="loginLogin">
    <div class="loginRegister">
        <a href="[[+logoutUrl]]" title="[[+actionMsg]]">[[+actionMsg]]</a>
    </div>
</div>


It leads to the same result. I can not log out.

The snippet adds a ?service=logout to the link above. No form data will be send and there should be no reason to check the recaptcha.

My snippet call is like this:

[[!Login? &tplType=`modChunk` &loginTpl=`lgnLoginTpl` &logoutTpl=`lgnLogoutTpl` &logoutResourceId=`1` &errTpl=`lgnErrTpl` &errTplType=`modChunk` &preHooks=`recaptchav2`]]


It's inside another chunk and always visible in the right sidebar. As far as I know the logout link should refer to the same page that contains the Login snippet call. The snippet switches between logoutTpl and loginTpl depending if the user is logged in or not.

I have no idea.

Best regards
Andre]]>
al5040 Jun 18, 2018, 08:37 PM https://forums.modx.com/thread/103963/login-and-recaptchav2---logout-not-possible#dis-post-559131
<![CDATA[Re: Login and RecaptchaV2 - Logout not possible]]> https://forums.modx.com/thread/103963/login-and-recaptchav2---logout-not-possible#dis-post-559124 BobRay Jun 18, 2018, 04:04 AM https://forums.modx.com/thread/103963/login-and-recaptchav2---logout-not-possible#dis-post-559124