Skip to content

Commit

Permalink
use Session#copy_attributes_from method in with_token_refetch
Browse files Browse the repository at this point in the history
  • Loading branch information
rachel-carvalho committed Apr 15, 2024
1 parent 2805ab4 commit fae7175
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/shopify_app/admin_api/with_token_refetch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ def with_token_refetch(session, shopify_id_token)
ShopifyApp::Logger.debug("Shopify API returned a 401 Unauthorized error, exchanging token and " \
"retrying with new session")
new_session = ShopifyApp::Auth::TokenExchange.perform(shopify_id_token)
# TODO: use copy_attributes_from when shopify_api is bumped to include it
# session.copy_attributes_from(new_session)
session.access_token = new_session.access_token
session.expires = new_session.expires
session.copy_attributes_from(new_session)
retry
end
raise
Expand Down

0 comments on commit fae7175

Please sign in to comment.