Sha256: dc50ae7d205953cf142b9b07fb967a4f64ce16cd73a1ae78a124fc6ec4339125

Contents?: true

Size: 1.69 KB

Versions: 9

Compression:

Stored size: 1.69 KB

Contents

Faalis::Engine.routes.draw do
  get 'templates/*path' => 'dashboard#jstemplate'

  # Authentications
  devise_config = {
    class_name: 'Faalis::User',
    :module =>  :devise,
    skip: :omniauth_callbacks
  }

  # Add omniauth callback if there was any provider
  unless Devise.omniauth_providers.empty?
    devise_config[:controllers] = {
      :omniauth_callbacks => 'faalis/omniauth/callbacks',
    }
  end

  localized_scope do
    in_dashboard do
      scope :auth do
        resources :groups, as: 'auth_groups'
        resources :users, as: 'auth_users' do
          member do
            get   'password', to: 'users#edit_password', as: 'auth_users_edit_password'
            patch 'password', to: 'users#update_password'
          end
        end
      end
      get '', to: '/faalis/dashboard#index', as: 'index'
      get '/404', to: '/faalis/dashboard#not_found', as: 'not_found'
    end

    devise_for :users, devise_config
  end

  #scope '(:locale)', locale: Regexp.new(::I18n.available_locales.join('|')) do
  #  scope Faalis::Engine.dashboard_namespace.to_sym do
      #get '' => 'dashboard#index', :as => 'dashboard'
  #    get 'modules' => 'dashboard#modules'
  #  end

  #devise_for :users, devise_config
  #end

  # match('/users/auth/:provider',
  #       constraints: { provider: /#{Devise.omniauth_configs.keys.join("|")}/ },
  #       controller: "devise/omniauth_callbacks#passthru",
  #       as: :user_omniauth_authorize,
  #       via: [:get, :post])

  # match('/users/auth/:action/callback',
  #       constraints: { action: /#{Devise.omniauth_configs.keys.join("|")}/ },
  #       controller: 'devise/omniauth_callbacks',
  #       as: :user_omniauth_callback,
  #       via: [:get, :post])

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
faalis-2.0.4 config/routes.rb
faalis-2.0.3 config/routes.rb
faalis-2.0.1 config/routes.rb
faalis-2.0.0 config/routes.rb
faalis-2.0.0.rc6 config/routes.rb
faalis-2.0.0.rc5 config/routes.rb
faalis-2.0.0.rc4 config/routes.rb
faalis-2.0.0.rc3 config/routes.rb
faalis-2.0.0.rc2 config/routes.rb