recaptchav2 icon indicating copy to clipboard operation
recaptchav2 copied to clipboard

Avoid the ReCaptcha test for logged-in users.

Open BobRay opened this issue 7 years ago • 8 comments

According to some reports, if the login and logout resource ID's are the same, user's can't logout if the ReCaptcha image is not present.

Maybe before running any tests you could do something like this:

If ($modx->user->hasSessionContext($modx->context->get('key'))) {
   return true;
}

BobRay avatar Jun 20 '18 03:06 BobRay

I just added a return true; at the top of the runPreLogoutHooks() function to work around this seeing as how my system never has any logout hooks... perhaps it would be useful separating preHooks into two separate parameters... ex: preLoginHooks, preLogoutHooks ... I dunno, what do you think?

(and make preHooks the synonym for preLoginHooks)

cjholowatyj avatar Jul 12 '18 16:07 cjholowatyj

Thanks for the great idea and input @BobRay

Question: is it safe enough to assume that we would never want to verify any request with a Context session?

(Maybe it is, just double checking..)

sepiariver avatar Nov 03 '18 06:11 sepiariver

Sorry, I missed this question until now. TBH, I really don't know.

BobRay avatar Nov 06 '18 03:11 BobRay

Maybe we could do a Snippet property to skip logged in users. But it’d have to be set in FormIt AND in the render Snippet. But if we do it in system settings it’ll apply to all instances on all pages, FormIt and Login.

sepiariver avatar Aug 31 '19 00:08 sepiariver

I can confirm this - ran into it today, a user cannot log out - should be a simple fix, just inspect the url for that service=logout bit and return true if it is there. (I can't think of a single reason to need to validate a logout)

BigBlockStudios avatar Sep 10 '19 17:09 BigBlockStudios

Also it needs (should) to work with the ForgotPassword snippet for flood control. Though at this time, ForgotPassword does not have a prehook property... soooooooo......

BigBlockStudios avatar Sep 10 '19 18:09 BigBlockStudios

just inspect the url for that service=logout bit and return true if it is there

What would happen if someone included that GET param on a request to a form that you wanted to properly validate with Recaptcha?

sepiariver avatar Sep 10 '19 21:09 sepiariver

I think @BobRay ‘s approach will work if we make it optional based on a Snippet property. I’ll target that for next release.

sepiariver avatar Sep 10 '19 21:09 sepiariver