func (p *politeiawww) handleNewUser(w http.ResponseWriter, r *http.Request) {
	log.Tracef("handleNewUser")

	// Get the new user command.
	var u v1.NewUser
	decoder := json.NewDecoder(r.Body)
	if err := decoder.Decode(&u); err != nil {
		RespondWithError(w, r, 0, "handleNewUser: unmarshal", v1.UserError{
			ErrorCode: v1.ErrorStatusInvalidInput,
		})
		return
	}

	reply, err := p.backend.ProcessNewUser(u)
	if err != nil {
		RespondWithError(w, r, 0, "handleNewUser: ProcessNewUser %v", err)
		return
	}

	// Reply with the verification token.
	util.RespondWithJSON(w, http.StatusOK, reply)
}
// handleNewUser handles the incoming new user command. It verifies that the new user
// doesn't already exist, and then creates a new user in the db and generates a random
// code used for verification. The code is intended to be sent to the specified email.
handleNewUser handles the incoming new user command. It verifies that the new user
doesn't already exist, and then creates a new user in the db and generates a random
code used for verification. The code is intended to be sent to the specified email.
// handleNewUser handles the incoming new user command . It verifies that the new user // doesn ' t already exist and then creates a new user in the db and generates a random // code used for verification . The code is intended to be sent to the specified email .
func (p *politeiawww) handleNewUser(w http.ResponseWriter, r *http.Request) {
	log.Tracef("handleNewUser")
	var u v1.NewUser
	decoder := json.NewDecoder(r.Body)
	if err := decoder.Decode(&u); err != nil {
		RespondWithError(w, r, 0, "handleNewUser: unmarshal", v1.UserError{
			ErrorCode: v1.ErrorStatusInvalidInput,
		})
		return
	}
	reply, err := p.backend.ProcessNewUser(u)
	if err != nil {
		RespondWithError(w, r, 0, "handleNewUser: ProcessNewUser %v", err)
		return
	}
	util.RespondWithJSON(w, http.StatusOK, reply)
}
func ( p * politeiawww ) handleNewUser ( w http . ResponseWriter , r * http . Request ) { log . Tracef ( " " ) var u v1 . NewUser decoder := json . NewDecoder ( r . Body ) if err := decoder . Decode ( & u ) ; err != nil { RespondWithError ( w , r , 0 , " " , v1 . UserError { ErrorCode : v1 . ErrorStatusInvalidInput , } ) return } reply , err := p . backend . ProcessNewUser ( u ) if err != nil { RespondWithError ( w , r , 0 , " " , err ) return } util . RespondWithJSON ( w , http . StatusOK , reply ) }
handleNewUser handles the incoming new user command.
handleNewUser handles the incoming new user command .
// Get the new user command. // Reply with the verification token.