FIX: properly defer authentication complete

This commit is contained in:
Sam Saffron 2016-02-08 08:44:12 +11:00
parent b0567f9c62
commit b032c63773
1 changed files with 12 additions and 5 deletions

View File

@ -33,6 +33,18 @@
</script>
<script>
<%- if !current_user && flash[:authentication_data] %>
require('discourse/routes/application').default.reopen({
actions: {
didTransition: function() {
Em.run.next(function(){
Discourse.authenticationComplete(<%=flash[:authentication_date].html_safe%>);
});
return this._super();
}
}
});
<%- end %>
Discourse.CDN = '<%= Rails.configuration.action_controller.asset_host %>';
Discourse.BaseUrl = '<%= RailsMultisite::ConnectionManagement.current_hostname %>'.replace(/:[\d]*$/,"");
Discourse.BaseUri = '<%= Discourse::base_uri %>';
@ -53,11 +65,6 @@
<%- end %>
Discourse.S3BaseUrl = '<%= Discourse.store.absolute_base_url %>';
<%- end %>
<%- if !current_user && flash[:authentication_data] %>
Em.run.next(function(){
Discourse.authenticationComplete(<%=flash[:authentication_data].html_safe%>);
});
<%- end %>
</script>
<%= script 'browser-update' %>