Changed authorize to authorize_user!
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user