From 33230f933454e64436dddb906d53512f97a60ce1 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Fri, 3 Mar 2023 21:25:38 -0600 Subject: Arregla algunos métodos de controladores MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/sessions_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/controllers/api/sessions_controller.rb') diff --git a/app/controllers/api/sessions_controller.rb b/app/controllers/api/sessions_controller.rb index 9d0e4ac..64d5464 100644 --- a/app/controllers/api/sessions_controller.rb +++ b/app/controllers/api/sessions_controller.rb @@ -2,7 +2,9 @@ module Api # The controller that handles authentications. - class SessionsController < ApplicationController + class SessionsController < AuthenticatedController + skip_before_action :validate_jwt, only: [:create] + def create @user_account = UserAccount.find_by(email: permitted_params[:email]) @@ -14,7 +16,7 @@ module Api end def destroy - user_account.update_attribute(:session_key, nil) + current_user_account.update_attribute(:session_key, nil) render status: :no_content end -- cgit v1.2.3