mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-07 19:50:33 +08:00
feat: improve error handling in AutoSigninFilter
This commit is contained in:
@@ -102,7 +102,12 @@ func AutoSigninFilter(ctx *context.Context) {
|
|||||||
userId = ctx.Input.Query("username")
|
userId = ctx.Input.Query("username")
|
||||||
password := ctx.Input.Query("password")
|
password := ctx.Input.Query("password")
|
||||||
if userId != "" && password != "" && ctx.Input.Query("grant_type") == "" {
|
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")
|
_, err = object.CheckUserPassword(owner, name, password, "en")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
responseError(ctx, err.Error())
|
responseError(ctx, err.Error())
|
||||||
|
Reference in New Issue
Block a user