From 0314685627a32c6cb527f1a09909ddfbaad464fc Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Mon, 6 Jul 2015 20:21:18 +0530 Subject: [PATCH] FIX: redirect signup to sso url if sso enabled --- app/assets/javascripts/discourse/routes/application.js.es6 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/routes/application.js.es6 b/app/assets/javascripts/discourse/routes/application.js.es6 index 17d5d824e9b..b2c58f4fc8f 100644 --- a/app/assets/javascripts/discourse/routes/application.js.es6 +++ b/app/assets/javascripts/discourse/routes/application.js.es6 @@ -172,7 +172,12 @@ const ApplicationRoute = Discourse.Route.extend(OpenComposer, { }, handleShowCreateAccount() { - this._autoLogin('createAccount', 'create-account'); + if (this.siteSettings.enable_sso) { + const returnPath = encodeURIComponent(window.location.pathname); + window.location = Discourse.getURL('/session/sso?return_path=' + returnPath); + } else { + this._autoLogin('createAccount', 'create-account'); + } }, _autoLogin(modal, modalClass, notAuto) {