Skip to content

Commit

Permalink
fix: don't proxy to tlink
Browse files Browse the repository at this point in the history
  • Loading branch information
micwallace committed Nov 19, 2024
1 parent 4b73457 commit 38ed5c3
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions javascript/tokenscript-viewer/src/components/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,13 @@ export class AppRoot {
viewerOrigin: this.viewerType.indexOf("tlink") === 0 ? "*" : document.location.origin,
tlinkRequestAdapter: async (data: TLinkRequest) => {

// Catch & process recaptcha request unless tlink

if (this.viewerType.indexOf("tlink") === -1) {
if (data.method === "getRecaptchaToken"){
const recaptchaRequest = data.payload as { siteKey?: string }
return {
...data,
response: await getRecaptchaToken(recaptchaRequest.siteKey)
};
}

throw new Error("Tlink adapter is not available in this context");
// Recaptcha requests can be processed here
if (data.method === "getRecaptchaToken"){
const recaptchaRequest = data.payload as { siteKey?: string }
return {
...data,
response: await getRecaptchaToken(recaptchaRequest.siteKey)
};
}

return new Promise((resolve, reject) => {
Expand Down

0 comments on commit 38ed5c3

Please sign in to comment.