UpdatePassword function
(id interface{}, password string)
| 89 | |
| 90 | // UpdatePassword function |
| 91 | func (userService *UserService) UpdatePassword(id interface{}, password string) (updatedUser *models.User, err error) { |
| 92 | user := &models.User{} |
| 93 | err = userService.getCollection().FindByID(id, user) |
| 94 | if err != nil { |
| 95 | return user, err |
| 96 | } |
| 97 | hash, _ := hashPassword(password) |
| 98 | user.Password = hash |
| 99 | err = userService.getCollection().Update(user) |
| 100 | return user, err |
| 101 | } |
| 102 | |
| 103 | // FindBy function |
| 104 | func (userService *UserService) FindBy(q bson.M) (users []models.User, err error) { |
no test coverage detected