Skip to content

Introduce alternative recaptcha script initialization

Chad Woolley requested to merge refactor-recaptcha-script-initialization into master

Introduce alternative reCAPTCHA script initialization

What does this MR do?

Adds a better approach for initializing reCAPTCHA script when used from Vue components, in support of #217722 (closed).

Overview

Simplifies and switches to a memoized approach for attaching the reCAPTCHA script to the document.

Note that this technically not a "refactor", since it is a new approach being added, and the previous approach still exists as part of the old Vue recaptcha modal used from issue create/edit, but this can be deleted when the new approach is finished and issues can be converted to use it.

See Tasks for more details.

See #217722 (closed) for an issue with full context on all planned implementation MRs.

See !50559 (closed) for a spike/Proof of Concept showing a full working implementation of the new reCAPTCHA GraphQL support.

Tasks

  • Add a memoized initRecaptchaScript function, which attaches the reCAPTCHA script to the document head.
  • It should return a Promise which resolves when the reCAPTCHA script has finished initialization.

Availability and Testing

Related Issues

Edited by Chad Woolley

Merge request reports