Skip to content

Commit

Permalink
Fixes a stack trace issue (500) during API authentication.
Browse files Browse the repository at this point in the history
- seems to happen in a *very* short window where the token
  is invalidated in the memcached from the time it is checked
  for and the time we get fields out of the token.
- stumbled into this scenario while attempting to reproduce bugzilla #1512839.
  • Loading branch information
abellotti committed Nov 21, 2017
1 parent ece6e89 commit 44e220d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/token_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ def reset_token(token)
def token_get_info(token, what = nil)
return {} unless token_valid?(token)

what.nil? ? token_store.read(token) : token_store.read(token)[what]
token_data = token_store.read(token)
return nil if token_data.nil?

what.nil? ? token_data : token_data[what]
end

def token_valid?(token)
Expand Down

0 comments on commit 44e220d

Please sign in to comment.