From 76ce02742df030164b29c583173fd2fdc9111b38 Mon Sep 17 00:00:00 2001 From: Divij Sharma Date: Fri, 5 Jan 2024 03:54:50 +0530 Subject: [PATCH] fix(api): fixed error handeling in authentication middleware --- pkg/auth/auth.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/auth/auth.go b/pkg/auth/auth.go index fe5ca59..ddde712 100644 --- a/pkg/auth/auth.go +++ b/pkg/auth/auth.go @@ -221,7 +221,7 @@ func AuthenticationMiddleware() gin.HandlerFunc { er := models.LicenseError{ Status: http.StatusUnauthorized, Message: "User name not found", - Error: err.Error(), + Error: result.Error.Error(), Path: c.Request.URL.Path, Timestamp: time.Now().Format(time.RFC3339), } @@ -236,7 +236,7 @@ func AuthenticationMiddleware() gin.HandlerFunc { er := models.LicenseError{ Status: http.StatusUnauthorized, Message: "Incorrect password", - Error: err.Error(), + Error: "Password does not match", Path: c.Request.URL.Path, Timestamp: time.Now().Format(time.RFC3339), }