Skip to content
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

ASUB-8193 Adding reCaptchav3 #1990

Closed

Conversation

LauraPinilla
Copy link
Contributor

If you have not filled out the checklist below, the pr is not ready for review.

Description

Render reCaptcha v3 in case the tenant has this config.

We are passing a parameter

reCaptcha V3 is the invisible reCaptcha provided by google. Once it's included on the page should look like the image below.
Screenshot 2024-03-11 at 2 01 29 p m
By default, google includes this in the bottom right corner.
reCaptcha v3 does not require action by the user, the recaptcha is returned automatically.

BotChallengeProtection component will accept a challengeIn attribute. This attribute could be one of:
'signup' || ‘signin’ || ‘magiclink’ || ‘checkout’

IF !!`${challengeIn}Recaptcha && (0 <=recaptchaScore && recaptchaScore <= 1) && !!recaptchaSiteKey
THEN render reCaptchaV3. reCaptchaV3 should be initialized by passing the recaptchaSiteKey

Currently, we have this enabled for org:subssinglesite site:the-daily-intelligencer env: sandbox admin. In case you need this setting for any tenant, please let us know.

Jira Ticket

https://arcpublishing.atlassian.net/browse/ASUB-8193

Acceptance Criteria

Update BotChallengeProtection component in identity-block

BotChallengeProtection will accept a challengeIn attribute. This attribute could be one of:
'signup' || ‘signin’ || ‘magiclink’ || ‘checkout’

IF !!`${challengeIn}Recaptcha && recaptchaScore between 0 - 1 &&!!recaptchaSiteKey
THEN render reCaptchaV3. reCaptchaV3 should be initialized by passing the recaptchaSiteKey

Every time you grab a response token from reCAPTCHA component, store the response in localStorage.

The BotChallengeProtection should be part of the Login block, and the reCaptcha token should be sent during the call to Identity.login();
User should be successfully Logged In when reCaptcha v3 is enabled for signin.

Test Steps

  • Add test steps a reviewer must complete to test this PR

Figma file

  1. Checkout this branch git checkout {branch name}
  2. npx fusion start -l @wpmedia/identity-block
  3. point the site configs on blocks.json to https://subssinglesite-the-daily-intelligencer-sandbox.api.cdn.arcpublishing.com (It has recaptchav3 enabled for signin), or enable the config for the tenant you are using.
  4. Create a page and includeIdentity Log In - Arc Block component. Check the component BotChallengeProtection is being rendered (reCaptcha v2 or reCaptchaV3, depending on the configs), and after ask for login the user should be logged In successfully.

Effect Of Changes

Before

Example: When I clicked the search button, the button turned red.

[include screenshot or gif or link to video, storybook would be awesome]

After

Example: When I clicked the search button, the button turned green.

[include screenshot or gif or link to video, storybook would be awesome]

Dependencies or Side Effects

Examples of dependencies or side effects are:

Author Checklist

The author of the PR should fill out the following sections to ensure this PR is ready for review.

  • Confirmed all the test steps a reviewer will follow above are working.
  • Confirmed there are no linter errors. Please run npm run lint to check for errors. Often, npm run lint:fix will fix those errors and warnings.
  • Ran this code locally and checked that there are not any unintended side effects. For example, that a CSS selector is scoped only to a particular block.
  • Confirmed this PR has reasonable code coverage. You can run npm run test:coverage to see your progress.
    • Confirmed this PR has unit test files
    • Ran npm run test, made sure all tests are passing
    • If the amount of work to write unit tests for this change are excessive,
      please explain why (so that we can fix it whenever it gets refactored).
  • Confirmed relevant documentation has been updated/added.

Reviewer Checklist

The reviewer of the PR should copy-paste this template into the review comments on review.

  • Linting code actions have passed.
  • Ran the code locally based on the test instructions.
    • I don’t think this is needed to be tested locally. For example, a padding style change (storybook?) or a logic change (write a test).
  • I am a member of the engine theme team so that I can approve and merge this. If you're not on the team, you won't have access to approve and merge this pr.
  • Looked to see that the new or changed code has code coverage, specifically. We want the global code coverage to keep on going up with targeted testing.

@LauraPinilla LauraPinilla requested a review from a team as a code owner March 11, 2024 20:20
@vgalatro vgalatro changed the base branch from arc-themes-release-version-2.2.1 to arc-themes-release-version-2.3.0 March 13, 2024 17:41
@@ -239,22 +239,24 @@
"login-form": {
"styles": {
"default": {
"font-family": "var(--font-family-primary)",
"font-family": "Inter",
"padding-bottom": "var(--global-spacing-5)",
Copy link
Contributor

@vgalatro vgalatro Mar 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like I mentioned in the other PR, Themes needs to use CSS logical properties in its default styles since we have RTL clients. Please look over https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values and convert any physical property that has a logical equivalent. In this file it seems to be just padding, margin, and width. Note that CSS shorthand props (like padding) are not logical, so use padding-block-start, padding-block-end, etc...

dependabot bot and others added 11 commits March 20, 2024 09:39
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.23.9 to 7.24.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.1/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.23.9 to 7.24.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.3/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@babel/plugin-proposal-decorators](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-proposal-decorators) from 7.23.9 to 7.24.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.1/packages/babel-plugin-proposal-decorators)

---
updated-dependencies:
- dependency-name: "@babel/plugin-proposal-decorators"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [axios](https://github.com/axios/axios) from 1.6.5 to 1.6.8.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.6.5...v1.6.8)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.4...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [sanitize-html](https://github.com/apostrophecms/sanitize-html) from 2.11.0 to 2.12.1.
- [Changelog](https://github.com/apostrophecms/sanitize-html/blob/main/CHANGELOG.md)
- [Commits](apostrophecms/sanitize-html@2.11.0...2.12.1)

---
updated-dependencies:
- dependency-name: sanitize-html
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [stylelint-use-logical](https://github.com/csstools/stylelint-use-logical) from 2.1.1 to 2.1.2.
- [Release notes](https://github.com/csstools/stylelint-use-logical/releases)
- [Changelog](https://github.com/csstools/stylelint-use-logical/blob/main/CHANGELOG.md)
- [Commits](csstools/stylelint-use-logical@v2.1.1...v2.1.2)

---
updated-dependencies:
- dependency-name: stylelint-use-logical
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* THEMES-891: implemented focal point into numbered list block

* THEMES-891: updated card list and extra large promo.

* THEMES-891: added support for focal point to remaining blocks.

* THEMES-891: fixed filter for results list, added focal point to search results list block.

* THEMES-891: fixed filter for medium promo.

* THEMES-891: added focal point to product featured image.
* THEMES-1675: added close on click handler.

* THEMES-1675: added tests for clicking on overlay.

* THEMES-1675: making sure test files are seen by test:changed-feature-branch.
* add fix for redirect

* add regwall fix more mobile

* update PB preview query param

* remove requireConfigFile config
Bumps [use-debounce](https://github.com/xnimorz/use-debounce) from 9.0.4 to 10.0.0.
- [Release notes](https://github.com/xnimorz/use-debounce/releases)
- [Changelog](https://github.com/xnimorz/use-debounce/blob/master/CHANGELOG.md)
- [Commits](xnimorz/use-debounce@9.0.4...10.0.0)

---
updated-dependencies:
- dependency-name: use-debounce
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@vgalatro vgalatro added the needs changes The reviewer has requested changes from the PR author label Mar 20, 2024
@LauraPinilla LauraPinilla deleted the ASUB-8193_ReCaptchaV3 branch May 14, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs changes The reviewer has requested changes from the PR author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants