Skip to content

Commit

Permalink
Use Context logger instead of puts
Browse files Browse the repository at this point in the history
  • Loading branch information
paulomarg committed Apr 25, 2022
1 parent 259ec46 commit f047d77
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/shopify_api/auth/jwt_payload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ def shop
@dest.gsub("https://", "")
end

# TODO: Remove before releasing v11
sig { params(shop: String).returns(T::Boolean) }
def validate_shop(shop)
puts "Deprecation notice: validate_shop will be removed in the next major release."
/\A[a-z0-9]+[a-z0-9\-\.]*[a-z0-9]+\.(myshopify\.(io|com)|spin\.dev)\z/.match?(shop)
Context.logger.warn(
"Deprecation notice: ShopifyAPI::Auth::JwtPayload.validate_shop no longer checks the given shop and always " \
"returns true. It will be removed in v11."
)
true
end

alias_method :eql?, :==
Expand Down

0 comments on commit f047d77

Please sign in to comment.