func ConnectUpdateUser(user *models.User, password string) error { salt := models.GetUserSalt() pwd := tools.EncodePassword(password, salt) user.Password = fmt.Sprintf("%s$%s", salt, pwd) return user.Update("UserName", "Password") }
func SaveNewPassword(user *models.User, password string) error { salt := models.GetUserSalt() user.Password = fmt.Sprintf("%s$%s", salt, tools.EncodePassword(password, salt)) return user.Update("Password", "Rands", "Updated") }