UX: Auth complete page/modal has a link to continue to the site to accomodate auth methods that can't automatically redirect to Discourse

This commit is contained in:
Neil Lalonde
2017-11-21 13:56:19 -05:00
parent 12beb77afa
commit 66e53f449a
2 changed files with 7 additions and 2 deletions

View File

@@ -19,13 +19,17 @@
<body>
<div class="dialog">
<p><%=t "login.close_window" %></p>
<p>
<%=t "login.auth_complete" %>
<a href="<%= Discourse.base_url.html_safe %>?authComplete=true"><%= t("login.click_to_continue") %></a>
</p>
<script type="text/javascript">
var authResult = <%=@auth_result.to_client_hash.to_json.html_safe%>;
// On facebook browser, just redirect and don't close
var ua = navigator.userAgent || navigator.vendor || window.opera;
if (!window.opener) {
localStorage.setItem('lastAuthResult', JSON.stringify(authResult));
window.location.href = '<%= Discourse.base_url.html_safe %>?authComplete=true';