diff options
author | Imre Farkas <ifarkas@gitlab.com> | 2018-10-26 16:47:03 +0200 |
---|---|---|
committer | Imre Farkas <ifarkas@gitlab.com> | 2018-11-05 11:36:45 +0100 |
commit | 8d900ade3832b3e2812f067ace19bad7fd286d54 (patch) | |
tree | e81f35ae24282ec1c2843ed786e4b2803ac958f6 /app/models | |
parent | ef220c4d5baaaec54d4e9f46a4a777c29e2c0363 (diff) | |
download | gitlab-ce-8d900ade3832b3e2812f067ace19bad7fd286d54.tar.gz |
Remove PersonalAccessTokensFinder#find_by methoduse_tokenauthenticatable_method_for_token_lookup
find_by_token is overriden by TokenAuthenticatable which can be easily
missed or confused with #find_by(:token) defined by ActiveRecord. First
step for safer usage is to remove #find_by.
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/user.rb | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index cc2cd1b7723..728ed7c0ef7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -460,12 +460,6 @@ class User < ActiveRecord::Base by_username(username).take! end - def find_by_personal_access_token(token_string) - return unless token_string - - PersonalAccessTokensFinder.new(state: 'active').find_by_token(token_string)&.user # rubocop: disable CodeReuse/Finder - end - # Returns a user for the given SSH key. def find_by_ssh_key_id(key_id) Key.find_by(id: key_id)&.user |