Sha256: ce8279cf278e445842882c0e13e9ae124967d7f3ea4641f8c23e2f52c3e3f1ab

Contents?: true

Size: 1.08 KB

Versions: 8

Compression:

Stored size: 1.08 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"
      put :archive, on: :collection
      put :restore, on: :collection
    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

8 entries across 8 versions & 1 rubygems

Version Path
katalyst-koi-4.10.3 config/routes.rb
katalyst-koi-4.10.2 config/routes.rb
katalyst-koi-4.10.1 config/routes.rb
katalyst-koi-4.10.0 config/routes.rb
katalyst-koi-4.9.5 config/routes.rb
katalyst-koi-4.9.4 config/routes.rb
katalyst-koi-4.9.3 config/routes.rb
katalyst-koi-4.9.2 config/routes.rb