Sha256: 2c6f570daa5f983f2394b43a9f2658127879d0f1345b81e11badea5fbea0ea53

Contents?: true

Size: 1.01 KB

Versions: 15

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

Rails.application.routes.draw do
  namespace :admin do
    resource :session, only: %i[new create destroy] do
      post :accept, to: "tokens#update"
    end

    resources :url_rewrites
    resources :admin_users do
      resources :credentials, only: %i[new create destroy]
      post :invite, on: :member, to: "tokens#create"
    end

    # JWT tokens have dots(represents the 3 parts of data) in them, so we need to allow them in the URL
    # can by pass if we use token as a query param
    get "token/:token", to: "tokens#show", as: :token, token: /[^\/]+/

    resource :cache, only: %i[destroy]
    resource :dashboard, only: %i[show]

    root to: redirect("admin/dashboard")
  end

  scope :admin do
    constraints ->(req) { req.session[:admin_user_id].present? } do
      mount Katalyst::Content::Engine, at: "content"
      mount Katalyst::Navigation::Engine, at: "navigation"
      mount Flipper::UI.app(Flipper) => "flipper" if Object.const_defined?("Flipper::UI")
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
katalyst-koi-4.9.1 config/routes.rb
katalyst-koi-4.9.0 config/routes.rb
katalyst-koi-4.8.1 config/routes.rb
katalyst-koi-4.8.0 config/routes.rb
katalyst-koi-4.7.3 config/routes.rb
katalyst-koi-4.6.0 config/routes.rb
katalyst-koi-4.5.9 config/routes.rb
katalyst-koi-4.5.8 config/routes.rb
katalyst-koi-4.5.7 config/routes.rb
katalyst-koi-4.5.6 config/routes.rb
katalyst-koi-4.5.5 config/routes.rb
katalyst-koi-4.5.4 config/routes.rb
katalyst-koi-4.5.3 config/routes.rb
katalyst-koi-4.5.2 config/routes.rb
katalyst-koi-4.5.1 config/routes.rb