Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 88cf643

Browse files
authored
Tweak UIA postMessage check to work cross-origin (#12878)
* Soften UIA fallback postMessage check to work cross-origin Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Do the same for the SSO UIA flow Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Check against MessageEvent::source instead Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent 7a91e3e commit 88cf643

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/views/auth/InteractiveAuthEntryComponents.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ export class SSOAuthEntry extends React.Component<ISSOAuthEntryProps, ISSOAuthEn
833833
};
834834

835835
private onReceiveMessage = (event: MessageEvent): void => {
836-
if (event.data === "authDone" && event.origin === this.props.matrixClient.getHomeserverUrl()) {
836+
if (event.data === "authDone" && event.source === this.popupWindow) {
837837
if (this.popupWindow) {
838838
this.popupWindow.close();
839839
this.popupWindow = null;
@@ -950,7 +950,7 @@ export class FallbackAuthEntry extends React.Component<IAuthEntryProps> {
950950
};
951951

952952
private onReceiveMessage = (event: MessageEvent): void => {
953-
if (event.data === "authDone" && event.origin === this.props.matrixClient.getHomeserverUrl()) {
953+
if (event.data === "authDone" && event.source === this.popupWindow) {
954954
this.props.submitAuthDict({});
955955
}
956956
};

0 commit comments

Comments
 (0)