code: func SignUp(c *m.ReqContext, form dtos.SignUpForm) Response {
  	if !setting.AllowUserSignUp {
  		return Error(401, "User signup is disabled", nil)
  	}
  
  	existing := m.GetUserByLoginQuery{LoginOrEmail: form.Email}
  	if err := bus.Dispatch(&existing); err == nil {
  		return Error(422, "User with same email address already exists", nil)
  	}
  
  	cmd := m.CreateTempUserCommand{}
  	cmd.OrgId = -1
  	cmd.Email = form.Email
  	cmd.Status = m.TmpUserSignUpStarted
  	cmd.InvitedByUserId = c.UserId
  	cmd.Code = util.GetRandomString(20)
  	cmd.RemoteAddr = c.Req.RemoteAddr
  
  	if err := bus.Dispatch(&cmd); err != nil {
  		return Error(500, "Failed to create signup", err)
  	}
  
  	bus.Publish(&events.SignUpStarted{
  		Email: form.Email,
  		Code:  cmd.Code,
  	})
  
  	metrics.M_Api_User_SignUpStarted.Inc()
  
  	return JSON(200, util.DynMap{"status": "SignUpCreated"})
  }
docs: // POST /api/user/signup