DEV: Add extension point to allow modifying SSO URL (#7937)

DEV: Add extension point to allow modifying SSO URL (#7937)

This allows plugins to, for example, add extra query params to the SSO URL when discourse redirects to to the SSO website.

diff --git a/app/controllers/session_controller.rb b/app/controllers/session_controller.rb
index b48ee8a..1ca3f8a 100644
--- a/app/controllers/session_controller.rb
+++ b/app/controllers/session_controller.rb
@@ -39,7 +39,7 @@ class SessionController < ApplicationController
       if SiteSetting.verbose_sso_logging
         Rails.logger.warn("Verbose SSO log: Started SSO process\n\n#{sso.diagnostics}")
       end
-      redirect_to sso.to_url
+      redirect_to sso_url(sso)
     else
       render body: nil, status: 404
     end
@@ -525,4 +525,9 @@ class SessionController < ApplicationController
     @sso_error = text
     render status: status, layout: 'no_ember'
   end
+
+  # extension to allow plugins to customize the SSO URL
+  def sso_url(sso)
+    sso.to_url
+  end
 end

GitHub sha: 997add3a