Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,9 @@ export class SSOAuthEntry extends React.Component<ISSOAuthEntryProps, ISSOAuthEn
};

private onReceiveMessage = (event: MessageEvent): void => {
if (event.data === "authDone" && event.origin === this.props.matrixClient.getHomeserverUrl()) {
// We don't check the origin here as we don't trust any incoming data and just use it as a ping to retry the request,
// and the HS may delegate the fallback to another origin, due to CORS we cannot inspect the origin of the popupWindow.
Comment thread
t3chguy marked this conversation as resolved.
Outdated
if (event.data === "authDone") {
if (this.popupWindow) {
this.popupWindow.close();
this.popupWindow = null;
Expand Down Expand Up @@ -950,7 +952,9 @@ export class FallbackAuthEntry extends React.Component<IAuthEntryProps> {
};

private onReceiveMessage = (event: MessageEvent): void => {
if (event.data === "authDone" && event.origin === this.props.matrixClient.getHomeserverUrl()) {
// We don't check the origin here as we don't trust any incoming data and just use it as a ping to retry the request,
// and the HS may delegate the fallback to another origin, due to CORS we cannot inspect the origin of the popupWindow.
if (event.data === "authDone") {
this.props.submitAuthDict({});
}
};
Expand Down