Commit a4d1c9ca authored by Gabriel Mazetto's avatar Gabriel Mazetto

encode encrypted token as base64 to be able to send in a query string

parent fcf258ff
......@@ -24,14 +24,14 @@ module Gitlab
def generate_logout_state
cipher = logout_token_cipher(oauth_salt, :encrypt)
encrypted = cipher.update(access_token) + cipher.final
"#{oauth_salt}:#{encrypted}"
"#{oauth_salt}:#{Base64.urlsafe_encode64(encrypted)}"
end
def extract_logout_token
return unless state
salt, encrypted = state.split(':', 2)
decipher = logout_token_cipher(salt, :decrypt)
decipher.update(encrypted) + decipher.final
decipher.update(Base64.urlsafe_decode64(encrypted)) + decipher.final
end
def get_oauth_state_return_to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment