Skip to content

Commit

Permalink
Set admin creation to only be possible by another authenticated admin
Browse files Browse the repository at this point in the history
  • Loading branch information
ZaikoXander committed Nov 15, 2024
1 parent 3ee7da3 commit 186a004
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module AuthenticatedAdmin
class RegistrationsController < DeviseTokenAuth::RegistrationsController
before_action :authenticate_admin!, only: [ :create ]
end
end
4 changes: 3 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Rails.application.routes.draw do
mount_devise_token_auth_for "Admin", at: "auth"
mount_devise_token_auth_for "Admin", at: "auth", controllers: {
registrations: "authenticated_admin/registrations"
}
resources :messages
resources :reservations
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
Expand Down

0 comments on commit 186a004

Please sign in to comment.