Scope message handler to confirmation iframe

This commit is contained in:
Ray Schamp 2015-10-25 12:06:34 -04:00
parent 3b729fcb0a
commit 2eb63e604d

View file

@ -70,6 +70,7 @@ var Splash = injectIntl(React.createClass({
}, },
onMessage: function (e) { onMessage: function (e) {
if (e.origin != window.location.origin) return; if (e.origin != window.location.origin) return;
if (e.source != this.refs.emailConfirmationiFrame.contentWindow) return;
if (e.data == 'resend-done') { if (e.data == 'resend-done') {
this.hideEmailConfirmationModal(); this.hideEmailConfirmationModal();
} else { } else {
@ -299,7 +300,7 @@ var Splash = injectIntl(React.createClass({
isOpen={this.state.emailConfirmationModalOpen} isOpen={this.state.emailConfirmationModalOpen}
onRequestClose={this.hideEmailConfirmationModal} onRequestClose={this.hideEmailConfirmationModal}
style={{content: emailConfirmationStyle}}> style={{content: emailConfirmationStyle}}>
<iframe <iframe ref="emailConfirmationiFrame"
src="/accounts/email_resend_standalone/" src="/accounts/email_resend_standalone/"
{...omit(emailConfirmationStyle, 'padding')} /> {...omit(emailConfirmationStyle, 'padding')} />
</Modal> </Modal>