diff --git a/app/assets/javascripts/discourse/controllers/login.js.es6 b/app/assets/javascripts/discourse/controllers/login.js.es6 index cd81f119c01..02969cf5e13 100644 --- a/app/assets/javascripts/discourse/controllers/login.js.es6 +++ b/app/assets/javascripts/discourse/controllers/login.js.es6 @@ -129,7 +129,7 @@ export default Ember.Controller.extend(ModalFunctionality, { if(customLogin){ customLogin(); } else { - var authUrl = Discourse.getURL("/auth/" + name); + const authUrl = loginMethod.get('customUrl') || Discourse.getURL("/auth/" + name); if (loginMethod.get("fullScreenLogin")) { window.location = authUrl; } else { diff --git a/lib/plugin/auth_provider.rb b/lib/plugin/auth_provider.rb index cbc12c6f450..570a245b081 100644 --- a/lib/plugin/auth_provider.rb +++ b/lib/plugin/auth_provider.rb @@ -2,7 +2,7 @@ class Plugin::AuthProvider def self.auth_attributes [:glyph, :background_color, :title, :message, :frame_width, :frame_height, :authenticator, - :title_setting, :enabled_setting, :full_screen_login] + :title_setting, :enabled_setting, :full_screen_login, :custom_url] end attr_accessor(*auth_attributes) @@ -13,6 +13,7 @@ class Plugin::AuthProvider def to_json result = {name: name} + result['customUrl'] = custom_url if custom_url result['titleOverride'] = title if title result['titleSetting'] = title_setting if title_setting result['enabledSetting'] = enabled_setting if enabled_setting