Permalink
Browse files

modified config/initializers/active_admin.rb to allow ActiveAdmin acc…

…ess without login
  • Loading branch information...
annamgithub committed Nov 9, 2019
1 parent bd7af1e commit e35b8a30f6b474a42c92d15fb656ac904276cbdd
@@ -12,8 +12,10 @@
# HashWithIndifferentAccess.new decoded
# end
class ApplicationController < ActionController::Base

protect_from_forgery with: :exception



def authorize_request
header = request.headers['Authorization']
header = header.split(' ').last if header
@@ -30,11 +30,12 @@
# will namespace routes to /hello_world/*
#
# To set no namespace by default, use:
# config.default_namespace = false
# config.default_namespace = false
#
# Default:
# config.default_namespace = :admin
#
config.default_namespace = :api

# You can customize the settings for each namespace by using
# a namespace block. For example, to change the site title
# within a namespace:
@@ -54,7 +55,9 @@
#
# This setting changes the method which Active Admin calls
# within the application controller.
config.authentication_method = :authenticate_admin_user!

# ANNA NOTE TO SELF: COME BACK HERE TO REQUIRE ACTIVE ADMIN AUTHENTICATION
#config.authentication_method = :authenticate_admin_user!

# == User Authorization
#
@@ -1,11 +1,13 @@
Rails.application.routes.draw do
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
post '/auth/login', to: 'authentication#login'
get '/auth/verify', to: 'authentication#verify'
resources :users
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html

resources :cards
# post '/auth/login', to: 'authentication#login'
# get '/auth/verify', to: 'authentication#verify'
scope '/api' do
resources :users
resources :games
resources :cards
end

end

0 comments on commit e35b8a3

Please sign in to comment.