uia fallback example: check event origin

This commit is contained in:
Richard van der Hoff 2016-10-07 16:26:28 +01:00 committed by GitHub
parent e850fd718d
commit 6c88d698ae

View file

@ -637,10 +637,11 @@ handle unknown login types:
var popupWindow;
var eventListener = function(ev) {
if (ev.data !== "authDone" ) {
// check it's the right message from the right place.
if (ev.data !== "authDone" || ev.origin !== homeserverUrl) {
return;
}
// close the popup
popupWindow.close();
window.removeEventListener("message", eventListener);