diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-20 00:11:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-20 00:11:26 +0300 |
commit | ce5c259086445d71b405833c60ca71cd8c33de63 (patch) | |
tree | c55a1c0d32b328c5ba20dac33a3b01e8b649b654 /app/models/oauth_access_token.rb | |
parent | f5e42f97372d5bfe06291698d25e0f9e68b61819 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/oauth_access_token.rb')
-rw-r--r-- | app/models/oauth_access_token.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/oauth_access_token.rb b/app/models/oauth_access_token.rb index 7d71e15d3c5..eac99e8d441 100644 --- a/app/models/oauth_access_token.rb +++ b/app/models/oauth_access_token.rb @@ -26,4 +26,13 @@ class OauthAccessToken < Doorkeeper::AccessToken super end + + # Override Doorkeeper::AccessToken.matching_token_for since we + # have `reuse_access_tokens` disabled and we also hash tokens. + # This ensures we don't accidentally return a hashed token value. + def self.matching_token_for(application, resource_owner, scopes) + return if Feature.enabled?(:hash_oauth_tokens) + + super + end end |