We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc0d31f commit 7049599Copy full SHA for 7049599
api/user/user.go
@@ -3,6 +3,7 @@ package user
3
import (
4
"github.com/0xJacky/Nginx-UI/internal/user"
5
"github.com/0xJacky/Nginx-UI/model"
6
+ "github.com/0xJacky/Nginx-UI/settings"
7
"github.com/gin-gonic/gin"
8
"github.com/uozi-tech/cosy"
9
"golang.org/x/crypto/bcrypt"
@@ -34,7 +35,7 @@ func InitManageUserRouter(g *gin.RouterGroup) {
34
35
36
c.ModifyHook(func(c *cosy.Ctx[model.User]) {
37
c.BeforeDecodeHook(func(ctx *cosy.Ctx[model.User]) {
- if ctx.ID == 1 {
38
+ if settings.NodeSettings.Demo && ctx.ID == 1 {
39
ctx.AbortWithError(user.ErrChangeInitUserPwdInDemo)
40
}
41
})
0 commit comments