Shopify / shopify-api-ruby

ShopifyAPI is a lightweight gem for accessing the Shopify admin REST and GraphQL web services.
MIT License
1.05k stars 468 forks source link

Add helper method alias to JwtPayload similar to ShopifyApp::JWT #1315

Closed zzooeeyy closed 4 months ago

zzooeeyy commented 4 months ago

Description

Add helper methods to JwtPayload with names similar to ShopifyApp JWT to make deprecation migration easier.

  def shopify_domain
    @payload && ShopifyApp::Utils.sanitize_shop_domain(@payload["dest"])
  end

  def shopify_user_id
    @payload["sub"].to_i if @payload && @payload["sub"]
  end

  def expire_at
    @payload["exp"].to_i if @payload && @payload["exp"]
  end

How has this been tested?

Unit tested the methods to return expected values

Checklist: