Skip to content

Add Recaptcha Component - resolves #192#233

Open
richardbishopme wants to merge 1 commit intoJeffreyWay:masterfrom
richardbishopme:bug/fix-captcha-render
Open

Add Recaptcha Component - resolves #192#233
richardbishopme wants to merge 1 commit intoJeffreyWay:masterfrom
richardbishopme:bug/fix-captcha-render

Conversation

@richardbishopme
Copy link
Copy Markdown

Hi Jeffrey,

This PR wraps the Recaptcha functionality into its own Vue component.

Issue

Currently, when a user tries to submit a thread through the modal by clicking the Add New Thread button, the Recaptcha checkbox doesn't render as it is now inside the modal component. As a result, the validation fails when submitting the thread.

Fix

To fix this, I created a Recaptcha component. When the mounted event fires, it passes the sitekey to the Recaptcha render script to get the necessary code for the Recaptcha box. The tag itself is very similar to what we had before:

<recaptcha ref="recaptcha" sitekey="{{ config('services.recaptcha.key') }}"></recaptcha>

An old file

I also removed the resources/views/threads/create.blade.php file as we now use the modal. I couldn't see it referenced anywhere and the tests still passed.

An existing unrelated bug

When testing, I noticed that when you submit a thread, we end up on the Thread detail screen. If we try to submit another thread, we end up getting a conflict with what looks like reply body field and the thread body field. It shows up in the validation errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants