From 48ba88de2d371b922aa806446137e8dce2ac1f72 Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Wed, 13 Aug 2025 15:27:52 +0800 Subject: [PATCH] feat: improve error handling in AutoSigninFilter --- routers/auto_signin_filter.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/routers/auto_signin_filter.go b/routers/auto_signin_filter.go index 7eec9f14..1ca3cab6 100644 --- a/routers/auto_signin_filter.go +++ b/routers/auto_signin_filter.go @@ -102,7 +102,12 @@ func AutoSigninFilter(ctx *context.Context) { userId = ctx.Input.Query("username") password := ctx.Input.Query("password") if userId != "" && password != "" && ctx.Input.Query("grant_type") == "" { - owner, name := util.GetOwnerAndNameFromId(userId) + owner, name, err := util.GetOwnerAndNameFromIdWithError(userId) + if err != nil { + responseError(ctx, err.Error()) + return + } + _, err = object.CheckUserPassword(owner, name, password, "en") if err != nil { responseError(ctx, err.Error())