Use Base64.strict_encode64 in discourse plugin

Base64.encode64 adds unneded newlines. Discourse can handle the newlines,
so this does not change the behaviour.
This commit is contained in:
Patrick Gansterer 2018-12-30 02:45:12 +01:00
parent 5dab748fe3
commit fdbdbb25cf
1 changed files with 1 additions and 1 deletions

View File

@ -10,7 +10,7 @@ class DiscourseController < ApplicationController
end
def redirect_to_with_payload(url, payload)
base64_payload = Base64.encode64 payload.to_query
base64_payload = Base64.strict_encode64 payload.to_query
sso = CGI::escape base64_payload
sig = get_hmac_hex_string base64_payload
redirect_to "#{url}#{url.include?('?') ? '&' : '?'}sso=#{sso}&sig=#{sig}"