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.
This commit is contained in:
Osama Sayegh 2019-07-25 00:18:27 +03:00 committed by GitHub
parent c1d2fb115c
commit 997add3af9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -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