markets / invisible_captcha

🍯 Unobtrusive and flexible spam protection for Rails apps
https://rubygems.org/gems/invisible_captcha
MIT License
1.16k stars 66 forks source link

Tips when used together with Sorcery gem. #106

Closed printfinn closed 2 years ago

printfinn commented 2 years ago

Background: Rails 7 introduces a redirect_back_or_to method which is used by redirect_back under the hood. Sorcery has a same name method redirect_back_or_to since ... a long time ago.

Because invisible_captcha will use redirect_back when a on_timestamp_spam is triggered, if Sorcery is also used in the project, it will overwrite the Rails redirect_back_or_to method, so invisible_captcha will redirect the user to root url, instead of displaying a "Sorry, that was too quick" alert.

The same name method issue is known to the Sorcery maintainer, to temporarily solve the issue, check this: #296

printfinn commented 2 years ago

Closing because it's not a invisible captcha issue.