uia fallback example: check event origin
This commit is contained in:
parent
e850fd718d
commit
6c88d698ae
1 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue