Changed authorize to authorize_user!
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled

This commit is contained in:
2024-08-25 21:26:35 +02:00
parent abe9267893
commit 0919a26686
7 changed files with 8 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
before_action :set_current_request_details before_action :set_current_request_details
before_action :authenticate before_action :authenticate_user!
private private
def current_user def current_user
@@ -19,7 +19,7 @@ class ApplicationController < ActionController::Base
end end
helper_method :user_signed_in? helper_method :user_signed_in?
def authenticate def authenticate_user!
unless user_signed_in? unless user_signed_in?
redirect_to sign_in_path redirect_to sign_in_path
end end

View File

@@ -1,5 +1,5 @@
class HomeController < ApplicationController class HomeController < ApplicationController
skip_before_action :authenticate skip_before_action :authenticate_user!
def index def index
end end
end end

View File

@@ -1,6 +1,5 @@
class Identity::EmailVerificationsController < ApplicationController class Identity::EmailVerificationsController < ApplicationController
skip_before_action :authenticate, only: :show skip_before_action :authenticate_user!, only: :show
before_action :set_user, only: :show before_action :set_user, only: :show
def show def show

View File

@@ -1,6 +1,5 @@
class Identity::PasswordResetsController < ApplicationController class Identity::PasswordResetsController < ApplicationController
skip_before_action :authenticate skip_before_action :authenticate_user!
before_action :set_user, only: %i[ edit update ] before_action :set_user, only: %i[ edit update ]
def new def new

View File

@@ -1,5 +1,5 @@
class RegistrationsController < ApplicationController class RegistrationsController < ApplicationController
skip_before_action :authenticate skip_before_action :authenticate_user!
def new def new
@user = User.new @user = User.new

View File

@@ -1,6 +1,5 @@
class SessionsController < ApplicationController class SessionsController < ApplicationController
skip_before_action :authenticate, only: %i[ new create ] skip_before_action :authenticate_user!, only: %i[ new create ]
before_action :set_session, only: :destroy before_action :set_session, only: :destroy
def index def index

View File

@@ -1,6 +1,6 @@
class VehiclesController < ApplicationController class VehiclesController < ApplicationController
before_action :set_vehicle, only: %i[ show edit update destroy ] before_action :set_vehicle, only: %i[ show edit update destroy ]
skip_before_action :authenticate skip_before_action :authenticate_user!
# has_many_attached :images # has_many_attached :images