Skip to content

Conversation

jklina
Copy link

@jklina jklina commented Sep 3, 2025

The script tag checks for validity by making sure there's a user_id or an email. When using signed fields, however, these fields are removed from the user_details hash, so each time both the user_id and the email fields are promoted to the JWT payload, they will invalidate the script tag even though the information is there, just moved into the payload. The invalid script tag is then quietly hidden from the views.

This attempts to fix the issue by ensuring the state of the user_fields hash is maintained for validation purposes.

Why?

Why are you making this change?

Promoting both the user_id and email fields to the JWT payload makes the script tag invalid.

How?

Technical details on your change

Use the original, unaltered, user_fields hash for validation. Tests are added to ensure different configuration options produce valid script tags.

The script tag checks for validity by making sure there's a `user_id` or
an `email`. When using signed fields, however, these fields are removed
from the `user_details` hash, so each time both the `user_id` and the
`email` fields are promoted to the JWT payload, they will invalidate the
script tag even though the information is there, just moved into the
payload.

This attempts to fix the issue by ensuring the state of the
`user_fields` hash is maintained for validation purposes.
@jklina jklina marked this pull request as ready for review September 3, 2025 20:23
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.

1 participant