Skip to content

Conversation

@moe-dev
Copy link
Contributor

@moe-dev moe-dev commented Mar 11, 2025

linked to: tkhq/sdk#535

auth/index.html Outdated
Comment on lines 1167 to 1171
if (event.data.dangerouslyOverrideIframeKeyTtl) {
await TKHQ.initEmbeddedKey(event.data.dangerouslyOverrideIframeKeyTtl);
} else {
await TKHQ.initEmbeddedKey();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's do validation to make sure the TTL passed is a number. In JS a lot of stuff is truthy.

I'd also like to simplify TKHQ.initEmbeddedKey so that it always expects an argument (the TTL). And here we can have:

var iframeKeyTtl = TURNKEY_EMBEDDED_KEY_TTL_IN_MILLIS
if (event.data.dangerouslyOverrideIframeKeyTtl && ...validation...) {
    iframeKeyTtl = event.data.dangerouslyOverrideIframeKeyTtl;
}

await TKHQ.initEmbeddedKey(iframeKeyTtl);

@moe-dev moe-dev merged commit 162add9 into main Mar 12, 2025
6 checks passed
@moe-dev moe-dev deleted the moe/iframe-custom-ttl branch March 12, 2025 15:31
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.

4 participants