MCPcopy Index your code
hub / github.com/1Panel-dev/KubePi / isDefaultAdminPassword

Function isDefaultAdminPassword

internal/api/v1/session/session.go:99–110  ·  view source on GitHub ↗
(u *v1User.User)

Source from the content-addressed store, hash-verified

97}
98
99func isDefaultAdminPassword(u *v1User.User) bool {
100 if u == nil || u.Name != defaultAdminName || !u.IsAdmin {
101 return false
102 }
103 if u.Type != "" && u.Type != v1User.LOCAL {
104 return false
105 }
106 if strings.TrimSpace(u.Authenticate.Password) == "" {
107 return false
108 }
109 return bcrypt.CompareHashAndPassword([]byte(u.Authenticate.Password), []byte(defaultAdminPassword)) == nil
110}
111
112func currentSessionProfile(ctx *context.Context) (UserProfile, bool) {
113 loginUser := server.SessionMgr.Start(ctx).Get("profile")

Callers 1

buildUserProfileMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected