Skip to content

Releases: byjpr/plug_shopify_embedded_switch

v0.1.0

18 Jul 08:35
Compare
Choose a tag to compare

Switches auth between URL Params and JWT, designed for Shopify App Bridge. Add the plug to any pipeline where you would like to do both URL param and JWT auth.

pipeline :demo do
  plug PlugShopifyEmbeddedSwitch
end

This plug will set three keys in the private object which you can use in follow up plugs.

  1. conn.private[:shopify_url_config] Shop Origin URL
  2. conn.private[:shopify_jwt_config] JWT Object
  3. conn.private[:shop_origin_type] will return either :jwt or :url

Installation

def deps do
  [
    {:plug_shopify_embedded_switch, "~> 0.1.0"}
  ]
end