Skip to content

Commit

Permalink
feat(openpassport-static): execute returned script
Browse files Browse the repository at this point in the history
  • Loading branch information
AngeloAyranji committed Jan 8, 2025
1 parent f402b2e commit c7933a0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion apps/openpassport-static/src/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function App() {
try {
const encodedAttestation = btoa(JSON.stringify(attestation));

await axios.get(
const response = await axios.get(
`${import.meta.env.VITE_APP_API_DOMAIN}/credentials/socials/openpassport/callback`,
{
params: {
Expand All @@ -27,6 +27,15 @@ export function App() {
},
}
);

const tempDiv = document.createElement('div');
tempDiv.innerHTML = response.data;

const scripts = tempDiv.getElementsByTagName('script');
for (let i = 0; i < scripts.length; i++) {
const script = scripts[i];
eval(script.textContent || '');
}
} catch (error) {
console.error('Error in callback:', error);
}
Expand Down

0 comments on commit c7933a0

Please sign in to comment.