Skip to content

Commit

Permalink
Fix reCapcha
Browse files Browse the repository at this point in the history
  • Loading branch information
vigstudio committed Feb 11, 2023
1 parent f3079be commit 69df7f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"homepage": "https://github.com/vigstudio/livewire-comments",
"license": "MIT",
"type": "laravel-library",
"version": "1.0.7",
"version": "1.0.8",
"authors": [
{
"name": "Nghiane.com",
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/comments.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
</div>


<script src="https://www.google.com/recaptcha/api.js?render={{ Config::get('vgcomment.recaptcha_key') }}"></script>
<script src="https://www.google.com/recaptcha/api.js?render={{ Config::get('vgcomment.recaptcha_key') ?? 'xxx' }}"></script>
</div>
15 changes: 8 additions & 7 deletions resources/views/livewire/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
@post-success-comments.window="cleanData()"
@open-form.window="$event.detail.open_id == {{ $request['parent_id'] ?: 0 }} ? open = true : open = false">

<form wire:submit.prevent x-data="{
request: @entangle('request').defer,
async submit() {
this.request.recaptcha_token = await grecaptcha.execute(@js(Config::get('vgcomment.recaptcha_key')), { action: '{{ $method }}' });
$wire.{{ $method }}();
}
}">
<form wire:submit.prevent
x-data="{
request: @entangle('request').defer,
async submit() {
@if (Config::get('vgcomment.recaptcha')) this.request.recaptcha_token = await grecaptcha.execute(@js(Config::get('vgcomment.recaptcha_key')), { action: '{{ $method }}' }); @endif
$wire.{{ $method }}();
}
}">

<div class="vcomments__form">
<div class="form__header">
Expand Down

0 comments on commit 69df7f0

Please sign in to comment.