MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / SetPassword

Method SetPassword

internal/model/user.go:96–101  ·  view source on GitHub ↗
(pwd string)

Source from the content-addressed store, hash-verified

94}
95
96func (u *User) SetPassword(pwd string) *User {
97 u.Salt = random.String(16)
98 u.PwdHash = TwoHashPwd(pwd, u.Salt)
99 u.PwdTS = time.Now().Unix()
100 return u
101}
102
103func CanSeeHides(permission int32) bool {
104 return permission&1 == 1

Callers 3

CreateUserFunction · 0.95
UpdateUserFunction · 0.95
LdapRegisterFunction · 0.95

Calls 3

StringFunction · 0.92
TwoHashPwdFunction · 0.85
NowMethod · 0.65

Tested by

no test coverage detected