diff --git a/api/middleware/jwt.go b/api/middleware/jwt.go index 27974d7e8..4ab71eb48 100644 --- a/api/middleware/jwt.go +++ b/api/middleware/jwt.go @@ -62,7 +62,10 @@ func JwtConfigGenerate(jwtKey, realmName string, db *gorm.DB, l *zap.SugaredLogg if err != nil { return false } - return usr.EmailEnabled + if usr.EmailEnabled && usr.AccountEnabled { + return true + } + return false }, Unauthorized: func(c *gin.Context, code int, message string) { l.Error("invalid login detected")