Activate function
(token string, email string)
| 123 | |
| 124 | // Activate function |
| 125 | func (authService *AuthService) Activate(token string, email string) (success bool, err error) { |
| 126 | user := &models.User{} |
| 127 | var userService = UserService{} |
| 128 | err = userService.getCollection().First(bson.M{"active": false, "confirmationToken": token, "email": email}, user) |
| 129 | if err != nil { |
| 130 | return false, err |
| 131 | } |
| 132 | user.Active = true |
| 133 | user.ConfirmationToken = "" |
| 134 | err = userService.getCollection().Update(user) |
| 135 | if err != nil { |
| 136 | return false, err |
| 137 | } |
| 138 | |
| 139 | go emailService.SendActiveEmail(bson.M{"_id": user.ID}) |
| 140 | return true, err |
| 141 | } |
| 142 | |
| 143 | // ResetPassword function |
| 144 | func (authService *AuthService) ResetPassword(token string, password string, email string) (success bool, err error) { |
nothing calls this directly
no test coverage detected