# frozen_string_literal: true module Api # The controller that handles authentications. class AuthenticationsController < ApplicationController AUTHENTICATION_ERROR = 'Credenciales incorrectas' def create @logic = logic @token = @logic.call render json: @token && return if @token render json: { message: AUTHENTICATION_ERROR}, status: :unauthorized end def destroy; end def refresh; end private def permitted_params params.require(:user_account).permit(:email, :password) end def service @service = Services::AuthenticationService.new(permitted_params) end end end