web: Improvements to ReCaptcha resizing #16171
Conversation
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-integrations canceled.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16171 +/- ##
=======================================
Coverage 92.77% 92.78%
=======================================
Files 836 836
Lines 45213 45213
=======================================
+ Hits 41946 41949 +3
+ Misses 3267 3264 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
kensternberg-authentik
left a comment
There was a problem hiding this comment.
So much fiddling.
ce70012 to
720907d
Compare
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-720907d346f08e6497f720c24d65636e8c9e7437
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)sAfterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-720907d346f08e6497f720c24d65636e8c9e7437Afterwards, run the upgrade commands from the latest release notes. |
* web: Remove comments from serialized HTML. * web: Apply color theme to iframe. * web: Fix issues surrounding reCaptcha resize events not propagating.
Details
This PR focuses on a few visual issues that arise in the Captcha stage when using ReCaptcha.
As reported in #15598, Recaptcha v2 and v3 do not resize in response to their parent iframe's change in height. Additionally, ReCaptcha's (latest?) logic for handling domain verification isn't compatible with our switch to blob URLs as a source for frames.
The current fix for this limited due to the nature of this three-layer deep iframe structure.
We have a few options for fixing this:
This PR uses option 2, expanding our existing resize logic to traverse the DOM tree and resize all relevant elements. This is a bit of a hack, and it's limited to expanding the captcha's iframe, but it has the least impact on the other captcha vendors.
Also included is a fix captcha iframes not inheriting the color scheme of the parent page, ensuring fewer slivers of white around the captcha.
What's not included
sizeparameterCloses #15598