Skip to content

Commit e3ff329

Browse files
authored
Merge pull request #175 from platformsh/allow-script-web-message-auth
Add allow-scripts permission to the authentication iframe
2 parents fdaeb66 + 763d57b commit e3ff329

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/authentication/connector.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ function checkForStorageAccess(auth: ClientConfiguration) {
7676
return new Promise((resolve, reject) => {
7777
removeIFrame();
7878

79-
createIFrame(`${auth.authentication_url}/request-storage-access.html`);
79+
createIFrame(`${auth.authentication_url}/request-storage-access.html`, {
80+
sandbox: "allow-scripts"
81+
});
8082
async function receiveMessage(event: MessageEvent) {
8183
if (event.origin !== auth.authentication_url) {
8284
return false;
@@ -405,7 +407,9 @@ const logInWithWebMessageAndPKCE = async (reset: boolean) => {
405407
window.addEventListener("message", receiveMessage, false);
406408

407409
const authUrl = encodeURL(auth.authorization, req);
408-
createIFrame(authUrl);
410+
createIFrame(authUrl, {
411+
sandbox: "allow-scripts"
412+
});
409413
} catch (err) {
410414
console.log("Error Silent refresh");
411415
console.log(err);

0 commit comments

Comments
 (0)