-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SD-172] Added support for CAPTCHAs in webforms #1320
base: release/2.17.0
Are you sure you want to change the base?
Conversation
</script> | ||
<template> | ||
<div v-if="captchaElementId" :id="captchaElementId"></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If applicable, the captcha checkbox/badge will be rendered here
} | ||
} | ||
|
||
export const getCaptchaResponse = async ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is called on submit of the form to get the captcha token
@@ -29,7 +37,8 @@ export function useWebformSubmit(formId: string) { | |||
site: config.tide.site | |||
}, | |||
headers: { | |||
'Content-Type': 'application/vnd.api+json;charset=UTF-8' | |||
'Content-Type': 'application/vnd.api+json;charset=UTF-8', | |||
'x-captcha-response': maybeCaptchaResponse || undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The captcha token is sent via a header to the nuxt server endpoint
} | ||
} | ||
|
||
const verifyCaptcha = async (event: H3Event) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where we take the token generated in the browser and validate it which the CAPTCHA provider, this needs to happen server side.
We have to get the webform from drupal here to check if the captcha is enabled or not.
ripple-framework Run #2236
Run Properties:
|
Project |
ripple-framework
|
Branch Review |
feature/SD-172-captcha-support
|
Run status |
Passed #2236
|
Run duration | 08m 37s |
Commit |
a66b177104: feat(@dpc-sdp/ripple-tide-webform): only load captcha scripts when captcha eleme...
|
Committer | Jeffrey Dowdle |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
196
|
View all changes introduced in this branch ↗︎ |
…upport multiple on a page
…pc-sdp/ripple-framework into feature/SD-172-captcha-support
…ting form changes
…red to be less finnicky
…pc-sdp/ripple-framework into feature/SD-172-captcha-support
…ptcha element is rendered this supports the content rating form, otherwise the third party scripts are loaded always on every page
Issue: https://digital-vic.atlassian.net/browse/SD-172
What I did
How to test
Checklist
For all PR's
For new components only