Last active
October 25, 2017 15:05
-
-
Save DmytroVasin/fd1814f8cb80316332f87185f2066998 to your computer and use it in GitHub Desktop.
Splited file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
ActiveAdmin.routes(self) | |
devise_for :users, skip: [:sessions, :registrations, :passwords, :confirmations] | |
devise_scope :user do | |
# Sessions: | |
post 'auth/sign_in', to: 'auth/sessions#create', as: :user_session, defaults: { format: 'js' } | |
get 'auth/sign_out', to: 'auth/sessions#destroy', as: :destroy_user_session, defaults: { format: 'html' } | |
# Registrations: | |
post 'auth', to: 'auth/registrations#create', as: :user_registration, defaults: { format: 'js' } | |
# Passwords | |
post 'auth/password', to: 'auth/passwords#create', defaults: { format: 'js' } | |
get 'auth/password', to: 'auth/passwords#edit', as: :edit_user_password, defaults: { format: 'html' } | |
put 'auth/password', to: 'auth/passwords#update', as: :user_password, defaults: { format: 'html' } | |
# Confirmations | |
get 'auth/confirmation', to: 'auth/confirmations#show', as: :user_confirmation, defaults: { format: 'html' } | |
post 'auth/confirmation', to: 'auth/confirmations#create', defaults: { format: 'html' } | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
root to: 'dashboards#show' | |
# API | |
# Namespaces.. | |
# Etc... | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sidekiq/web' | |
Sidekiq::Web.use Rack::Auth::Basic do |username, password| | |
# NOTE: https://github.com/mperham/sidekiq/wiki/Monitoring | |
ActiveSupport::SecurityUtils.secure_compare(::Digest::SHA256.hexdigest(username), ::Digest::SHA256.hexdigest(ENV.fetch('ADMIN_NAME'))) & | |
ActiveSupport::SecurityUtils.secure_compare(::Digest::SHA256.hexdigest(password), ::Digest::SHA256.hexdigest(ENV.fetch('ADMIN_PASSWORD'))) | |
end if Rails.env.production? | |
Rails.application.routes.draw do | |
mount Sidekiq::Web, at: '/sidekiq' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment