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) {