From 3b1519a2d121efd18de59b935da6e652757eee90 Mon Sep 17 00:00:00 2001 From: Jason Scragz Date: Thu, 2 Nov 2017 15:16:47 -0700 Subject: [PATCH] if access is a string then use it directly fixes "undefined local variable or method `refresh_token'" pretty sure this was a typo? --- lib/redd/auth_strategies/web.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/redd/auth_strategies/web.rb b/lib/redd/auth_strategies/web.rb index ecab0cc..8bb3851 100644 --- a/lib/redd/auth_strategies/web.rb +++ b/lib/redd/auth_strategies/web.rb @@ -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))