Skip to content

Commit

Permalink
if access is a string then use it directly
Browse files Browse the repository at this point in the history
fixes "undefined local variable or method `refresh_token'"
pretty sure this was a typo?
  • Loading branch information
scragz authored and avinashbot committed Nov 2, 2017
1 parent f6bce1b commit 3b1519a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/redd/auth_strategies/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def refreshable?(access)
# Refresh the authentication and return a new refreshed access
# @return [Access] the new access
def refresh(access)
token = access.is_a?(String) ? refresh_token : access.refresh_token
token = access.is_a?(String) ? access : access.refresh_token
response = post('/api/v1/access_token', grant_type: 'refresh_token', refresh_token: token)
# When refreshed, the response doesn't include an access token, so we have to add it.
Models::Access.new(response.body.merge(refresh_token: token))
Expand Down

0 comments on commit 3b1519a

Please sign in to comment.