FIX: On facebook browser, don't close the window but redirect instead
This commit is contained in:
parent
df368ce251
commit
eee15dfe7f
|
@ -23,7 +23,14 @@
|
|||
|
||||
<script type="text/javascript">
|
||||
window.opener.Discourse.authenticationComplete(<%=@auth_result.to_client_hash.to_json.html_safe%>);
|
||||
window.close();
|
||||
|
||||
// On facebook browser, just redirect and don't close
|
||||
var ua = navigator.userAgent || navigator.vendor || window.opera;
|
||||
if ((ua.indexOf("FBAN") > -1) || (ua.indexOf("FBAV") > -1)) {
|
||||
window.location.href = <%= Discourse.base_url.inspect %>;
|
||||
} else {
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
|
|
Loading…
Reference in New Issue