+ User.ResetPassword
This commit is contained in:
parent
5972bb3a88
commit
6ce1dfd94c
@ -46,6 +46,12 @@ func (u User) IsUsingThisPassword(password string) bool {
|
|||||||
return generatePasswordHash(password, u.Salt) == u.PasswordHash
|
return generatePasswordHash(password, u.Salt) == u.PasswordHash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (u User) ResetPassword(newPassword string) (User, error) {
|
||||||
|
u.PasswordHash = generatePasswordHash(newPassword, u.Salt)
|
||||||
|
|
||||||
|
return u, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (g Group) AddMember(u User) (Group, error) {
|
func (g Group) AddMember(u User) (Group, error) {
|
||||||
if !utils.IsValidUUID(u.UUID) {
|
if !utils.IsValidUUID(u.UUID) {
|
||||||
return g, errors.New("unvalid UUID")
|
return g, errors.New("unvalid UUID")
|
||||||
|
Loading…
Reference in New Issue
Block a user