Commit 29cfb411 authored by Gabriel Mazetto's avatar Gabriel Mazetto

prevent decrypt error and recover access_token correctly

parent e2079bf3
......@@ -35,7 +35,10 @@ class Oauth::GeoAuthController < ActionController::Base
def logout
oauth = Gitlab::Geo::OauthSession.new(state: params[:state])
access_token = oauth.extract_logout_token
token_string = oauth.extract_logout_token
access_token_error('invalid') unless token_string.is_utf8?
access_token = Doorkeeper::AccessToken.by_token(token_string)
access_token_status = Oauth2::AccessTokenValidationService.validate(access_token)
if access_token_status == Oauth2::AccessTokenValidationService::VALID
......
......@@ -66,7 +66,8 @@ module Gitlab
cipher = OpenSSL::Cipher::AES.new(128, :CBC)
cipher.send(operation)
cipher.iv = salt
cipher.key = Gitlab::Application.secrets.secret_key_base
cipher.key = Gitlab::Application.secrets.db_key_base
cipher.auth_data = ''
cipher
end
......
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