From 8540113527a15d5af2e784cb9b208a77bbaeab69 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 28 Mar 2024 10:35:02 +0800 Subject: [PATCH] :art: Improve response details for auth check https://ld246.com/article/1711591523782 --- kernel/model/session.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/model/session.go b/kernel/model/session.go index 80dbdcd9f..d3d80dc26 100644 --- a/kernel/model/session.go +++ b/kernel/model/session.go @@ -242,7 +242,7 @@ func CheckAuth(c *gin.Context) { return } - c.JSON(http.StatusUnauthorized, map[string]interface{}{"code": -1, "msg": "Auth failed"}) + c.JSON(http.StatusUnauthorized, map[string]interface{}{"code": -1, "msg": "Auth failed [header: Authorization]"}) c.Abort() return } @@ -255,7 +255,7 @@ func CheckAuth(c *gin.Context) { return } - c.JSON(http.StatusUnauthorized, map[string]interface{}{"code": -1, "msg": "Auth failed"}) + c.JSON(http.StatusUnauthorized, map[string]interface{}{"code": -1, "msg": "Auth failed [query: token]"}) c.Abort() return } @@ -285,7 +285,7 @@ func CheckAuth(c *gin.Context) { return } - c.JSON(http.StatusUnauthorized, map[string]interface{}{"code": -1, "msg": "Auth failed"}) + c.JSON(http.StatusUnauthorized, map[string]interface{}{"code": -1, "msg": "Auth failed [session]"}) c.Abort() return }