diff --git a/src/api/api.go b/src/api/api.go index adbb353..c5d205d 100644 --- a/src/api/api.go +++ b/src/api/api.go @@ -31,6 +31,7 @@ type GroupEntry struct { type RegisterNumberRequest struct { UseVoice bool `json:"use_voice"` + Captcha string `json:"captcha"` } type VerifyNumberSettings struct { @@ -328,6 +329,7 @@ func (a *Api) RegisterNumber(c *gin.Context) { } } else { req.UseVoice = false + req.Captcha = "" } if number == "" { @@ -341,6 +343,10 @@ func (a *Api) RegisterNumber(c *gin.Context) { command = append(command, "--voice") } + if req.Captcha != "" { + command = append(command, []string{"--captcha", req.Captcha}...) + } + _, err := runSignalCli(true, command, "") if err != nil { c.JSON(400, gin.H{"error": err.Error()})