feat: improve error handling in AutoSigninFilter

This commit is contained in:
Yang Luo
2025-08-13 15:27:52 +08:00
parent a3a142db39
commit 48ba88de2d

View File

@@ -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())