mirror of
https://github.com/projekteuler/projekteuler.git
synced 2026-01-26 18:18:51 +01:00
Use Omniauthable user model with admin role
This commit is contained in:
@@ -233,6 +233,7 @@ Devise.setup do |config|
|
||||
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
||||
# up on your models and hooks.
|
||||
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
||||
config.omniauth :developer, fields: [:name], uid_field: :name
|
||||
|
||||
# ==> Warden configuration
|
||||
# If you want to use other strategies, that are not supported by Devise, or
|
||||
|
||||
@@ -22,7 +22,13 @@ Rails.application.routes.draw do
|
||||
resources :translations, only: [:new, :create]
|
||||
end
|
||||
|
||||
devise_for :admins, skip: :registrations
|
||||
devise_for :users, :controllers => {
|
||||
:omniauth_callbacks => "users/omniauth_callbacks"
|
||||
}
|
||||
devise_scope :user do
|
||||
delete 'sign_out', :to => 'devise/sessions#destroy', :as => :destroy_user_session
|
||||
end
|
||||
|
||||
namespace :admin do
|
||||
get '', to: 'dashboard#index', as: 'dashboard_index'
|
||||
post '/update_problem_count', to: 'dashboard#update_problem_count', as: 'dashboard_update_problem_count'
|
||||
|
||||
Reference in New Issue
Block a user