func (s *fixedService) Register(username, password, email, first, last string) (string, error) { u := users.New() u.Username = username u.Password = calculatePassHash(password, u.Salt) u.Email = email u.FirstName = first u.LastName = last err := db.CreateUser(&u) return u.UserID, err }
func (s *fixedService) PostUser(u users.User) (string, error) { u.NewSalt() u.Password = calculatePassHash(u.Password, u.Salt) err := db.CreateUser(&u) return u.UserID, err }