From e16dd96b6d752bfdf2e0a5556dbc5682ff5e62d2 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 15 Aug 2014 12:13:10 +1000 Subject: [PATCH] FIX: dispatch correct modal on auto login --- .../javascripts/discourse/routes/application.js.es6 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/routes/application.js.es6 b/app/assets/javascripts/discourse/routes/application.js.es6 index e37aff147e3..2473f49e13a 100644 --- a/app/assets/javascripts/discourse/routes/application.js.es6 +++ b/app/assets/javascripts/discourse/routes/application.js.es6 @@ -32,7 +32,7 @@ var ApplicationRoute = Em.Route.extend({ var returnPath = encodeURIComponent(window.location.pathname); window.location = Discourse.getURL('/session/sso?return_path=' + returnPath); } else { - this.send('autoLogin', function(){ + this.send('autoLogin', 'login', function(){ Discourse.Route.showModal(self, 'login'); self.controllerFor('login').resetForm(); }); @@ -43,17 +43,17 @@ var ApplicationRoute = Em.Route.extend({ showCreateAccount: function() { var self = this; - self.send('autoLogin', function(){ + self.send('autoLogin', 'createAccount', function(){ Discourse.Route.showModal(self, 'createAccount'); }); }, - autoLogin: function(onFail){ + autoLogin: function(modal, onFail){ var methods = Em.get('Discourse.LoginMethod.all'); if (!Discourse.SiteSettings.enable_local_logins && methods.length === 1) { - Discourse.Route.showModal(this, 'login'); - this.controllerFor('login').send("externalLogin", methods[0]); + Discourse.Route.showModal(this, modal); + this.controllerFor('login').send('externalLogin', methods[0]); } else { onFail(); }