Shopifex v0.3.3 ShopifexWeb.AuthController behaviour View Source

You can use this module inside of another controller to handle initial iFrame load and shop installation

Example:

defmodule MyAppWeb.AuthController do
  use MyAppWeb, :controller
  use ShopifexWeb.AuthController

  # Thats it! Validation, installation are now handled for you :)
end

Link to this section Summary

Callbacks

An optional callback called after the installation is completed, the shop is persisted in the database and webhooks are registered. By default, this function redirects the user to the app within their Shopify admin panel.

Link to this section Callbacks

Link to this callback

after_install(arg1, arg2)

View Source (optional)

Specs

after_install(Plug.Conn.t(), Ecto.Schema.t()) :: Plug.Conn.t()

An optional callback called after the installation is completed, the shop is persisted in the database and webhooks are registered. By default, this function redirects the user to the app within their Shopify admin panel.

Example

def after_install(conn, shop) do
  # send yourself an e-mail about shop installation

  # follow default behaviour.
  super(conn, shop)
end