Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions config/initializers/avo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@

## == Authentication ==
config.current_user_method = :current_user
# config.authenticate_with do
# end
config.authenticate_with do
warden.authenticate! scope: :user
end

## == Authorization ==
# config.is_admin_method = :is_admin
Expand Down
7 changes: 1 addition & 6 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
Rails.application.routes.draw do
if Rails.env.development?
authenticate :user, lambda { |u| u.admin? } do
mount GoodJob::Engine => "/admin/good_job"
mount Avo::Engine => "/admin"
else
authenticate :user, lambda { |u| u.admin? } do
mount GoodJob::Engine => "/admin/good_job"
mount Avo::Engine => "/admin"
end
end

# Custom Avo tool routes
Expand Down
Loading