feat: improve error handling in AutoSigninFilter

This commit is contained in:
Yang Luo
2025-07-08 23:47:14 +08:00
parent 9bbe5afb7c
commit 146a369f80

View File

@@ -66,6 +66,10 @@ func AutoSigninFilter(ctx *context.Context) {
responseError(ctx, err.Error()) responseError(ctx, err.Error())
return return
} }
if application == nil {
responseError(ctx, fmt.Sprintf("No application is found for userId: app/%s", token.Application))
return
}
setSessionUser(ctx, userId) setSessionUser(ctx, userId)
setSessionOidc(ctx, token.Scope, application.ClientId) setSessionOidc(ctx, token.Scope, application.ClientId)