Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Next
* Fix flash not being updated when responding to :turbo_stream requests

## 5.20.0
* turn recpatch reply into a object with logic
Expand Down
4 changes: 3 additions & 1 deletion lib/recaptcha/adapters/controller_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def recaptcha_error(model, attribute, message)
end

def recaptcha_flash_supported?
request.respond_to?(:format) && request.format == :html && respond_to?(:flash)
request.respond_to?(:format) && respond_to?(:flash) && (
request.format == :html || request.format == :turbo_stream
)
end

# Extracts response token from params. params['g-recaptcha-response-data'] for recaptcha_v3 or
Expand Down