redirect back to base uri if there is no window opener.

This commit is contained in:
Sam 2015-10-13 12:03:43 +11:00
parent 25db4cc4d9
commit 57e3323663

View File

@ -22,8 +22,12 @@
<p><%=t "login.close_window" %></p>
<script type="text/javascript">
window.opener.Discourse.authenticationComplete(<%=@auth_result.to_client_hash.to_json.html_safe%>);
window.close();
if(window.opener) {
window.opener.Discourse.authenticationComplete(<%=@auth_result.to_client_hash.to_json.html_safe%>);
window.close();
} else {
window.location = '<%= Discourse.base_uri("/") %>';
}
</script>
</div>
</body>