Merge pull request #4052 from matrix-org/t3chguy/recaptcha_protocol
Fix recaptcha blocked by CSP for non-SSL origins
This commit is contained in:
commit
67aa241ee5
1 changed files with 1 additions and 5 deletions
|
@ -61,13 +61,9 @@ export default createReactClass({
|
||||||
} else {
|
} else {
|
||||||
console.log("Loading recaptcha script...");
|
console.log("Loading recaptcha script...");
|
||||||
window.mx_on_recaptcha_loaded = () => {this._onCaptchaLoaded();};
|
window.mx_on_recaptcha_loaded = () => {this._onCaptchaLoaded();};
|
||||||
let protocol = global.location.protocol;
|
|
||||||
if (protocol !== "http:") {
|
|
||||||
protocol = "https:";
|
|
||||||
}
|
|
||||||
const scriptTag = document.createElement('script');
|
const scriptTag = document.createElement('script');
|
||||||
scriptTag.setAttribute(
|
scriptTag.setAttribute(
|
||||||
'src', `${protocol}//www.recaptcha.net/recaptcha/api.js?onload=mx_on_recaptcha_loaded&render=explicit`,
|
'src', `https://www.recaptcha.net/recaptcha/api.js?onload=mx_on_recaptcha_loaded&render=explicit`,
|
||||||
);
|
);
|
||||||
this._recaptchaContainer.current.appendChild(scriptTag);
|
this._recaptchaContainer.current.appendChild(scriptTag);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue