Sha256: c853f99e4aaeb548dfebed1e18529204759d4018ee7362f3e80c19f1d55ec396

Contents?: true

Size: 1017 Bytes

Versions: 22

Compression:

Stored size: 1017 Bytes

Contents

# frozen_string_literal: true

ShopifyApp::Engine.routes.draw do
  login_url = ShopifyApp.configuration.login_url.gsub(/^#{ShopifyApp.configuration.root_url}/, "")
  login_callback_url = ShopifyApp.configuration.login_callback_url.gsub(/^#{ShopifyApp.configuration.root_url}/, "")

  controller :sessions do
    get login_url => :new, :as => :login
    post login_url => :create, :as => :authenticate
    get "logout" => :destroy, :as => :logout

    # Kept to prevent apps relying on these routes from breaking
    if login_url.gsub(%r{^/}, "") != "login"
      get "login" => :new, :as => :default_login
      post "login" => :create, :as => :default_authenticate
    end
  end

  controller :callback do
    get login_callback_url => :callback

    # Kept to prevent apps relying on these routes from breaking
    if login_callback_url.gsub(%r{^/}, "") != "auth/shopify/callback"
      get "auth/shopify/callback" => :default_callback
    end
  end

  namespace :webhooks do
    post ":type" => :receive
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
shopify_app-21.10.0 config/routes.rb
shopify_app-21.9.0 config/routes.rb
shopify_app-21.8.1 config/routes.rb
shopify_app-21.8.0 config/routes.rb
shopify_app-21.7.0 config/routes.rb
shopify_app-21.6.0 config/routes.rb
shopify_app-21.5.0 config/routes.rb
shopify_app-21.4.1 config/routes.rb
shopify_app-21.4.0 config/routes.rb
shopify_app-21.3.1 config/routes.rb
shopify_app-21.3.0 config/routes.rb
shopify_app-21.2.0 config/routes.rb
shopify_app-21.1.1 config/routes.rb
shopify_app-21.1.0 config/routes.rb
shopify_app-21.0.0 config/routes.rb
shopify_app-20.2.0 config/routes.rb
shopify_app-20.1.1 config/routes.rb
shopify_app-20.1.0 config/routes.rb
shopify_app-20.0.2 config/routes.rb
shopify_app-20.0.1 config/routes.rb