Skip to content

Commit

Permalink
Apply admin authentication need for messages/reservations controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
ZaikoXander committed Nov 13, 2024
1 parent cbc8d4c commit 3ee7da3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/controllers/messages_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class MessagesController < ApplicationController
before_action :authenticate_admin!, only: %i[ index show update destroy ]
before_action :set_message, only: %i[ show update destroy ]

# GET /messages
Expand Down
1 change: 1 addition & 0 deletions app/controllers/reservations_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class ReservationsController < ApplicationController
before_action :authenticate_admin!, only: %i[ index show update destroy ]
before_action :set_reservation, only: %i[ show update destroy ]

# GET /reservations
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/cors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

resource "*",
headers: :any,
expose: [ "Access-Token", "Uid", "Client" ],
expose: [ "authorization" ],
methods: [ :get, :post, :put, :patch, :delete, :options, :head ]
end
end
2 changes: 1 addition & 1 deletion config/initializers/devise_token_auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# client is responsible for keeping track of the changing tokens. Change
# this to false to prevent the Authorization header from changing after
# each request.
# config.change_headers_on_each_request = true
config.change_headers_on_each_request = false

# By default, users will need to re-authenticate after 2 weeks. This setting
# determines how long tokens will remain valid after they are issued.
Expand Down

0 comments on commit 3ee7da3

Please sign in to comment.