From eff28652782b312c3ae69cf27470bc17575814fa Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 10 Jun 2016 11:12:46 -0400 Subject: [PATCH] FIX: Support create account on facebook browser --- .../discourse/initializers/auth-complete.js.es6 | 13 +++++++++++++ .../users/omniauth_callbacks/complete.html.erb | 7 +++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 app/assets/javascripts/discourse/initializers/auth-complete.js.es6 diff --git a/app/assets/javascripts/discourse/initializers/auth-complete.js.es6 b/app/assets/javascripts/discourse/initializers/auth-complete.js.es6 new file mode 100644 index 00000000000..613d03fd115 --- /dev/null +++ b/app/assets/javascripts/discourse/initializers/auth-complete.js.es6 @@ -0,0 +1,13 @@ +export default { + name: "auth-complete", + after: "inject-objects", + initialize() { + if (window.location.search.indexOf('authComplete=true') !== -1) { + const lastAuthResult = localStorage.getItem('lastAuthResult'); + if (lastAuthResult) { + Discourse.authenticationComplete(JSON.parse(lastAuthResult)); + } + } + } +}; + diff --git a/app/views/users/omniauth_callbacks/complete.html.erb b/app/views/users/omniauth_callbacks/complete.html.erb index 07bd7014636..4d7f5dd9ecb 100644 --- a/app/views/users/omniauth_callbacks/complete.html.erb +++ b/app/views/users/omniauth_callbacks/complete.html.erb @@ -22,12 +22,15 @@

<%=t "login.close_window" %>