summaryrefslogtreecommitdiff
path: root/app/controllers/api
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-02-23 18:51:51 -0600
committerHombreLaser <sebastian-440@live.com>2023-02-23 18:51:51 -0600
commit91a11ca69d372b8b93b4b56ff716d8578a86500e (patch)
tree5f31570567bb93a251ad9390932b47d33efe5948 /app/controllers/api
parentf7a0fb572e4518146ec9cb29669d12cd22b4dc11 (diff)
Arregla la autenticación
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/authentications_controller.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/api/authentications_controller.rb b/app/controllers/api/authentications_controller.rb
index f2fb993..85ef3d4 100644
--- a/app/controllers/api/authentications_controller.rb
+++ b/app/controllers/api/authentications_controller.rb
@@ -6,12 +6,12 @@ module Api
AUTHENTICATION_ERROR = 'Credenciales incorrectas'
def create
- @logic = logic
+ @logic = logic.new(permitted_params)
@token = @logic.call
- render json: @token && return if @token
+ render json: @token, status: :ok and return if @token
- render json: { message: AUTHENTICATION_ERROR}, status: :unauthorized
+ render json: { message: AUTHENTICATION_ERROR }, status: :unauthorized
end
def destroy; end
@@ -21,7 +21,7 @@ module Api
private
def permitted_params
- params.require(:user_account).permit(:email, :password)
+ params.require(:credentials).permit(:email, :password)
end
def service