celestix / gotgproto

A wrapper for Go Telegram Client, i.e. gotd/td.
GNU General Public License v3.0
199 stars 36 forks source link

2fa password is freeze #89

Open frech87 opened 1 month ago

frech87 commented 1 month ago

Hi. When run auth example, after input 2fa password process is waiting and don't return success or error

celestix commented 1 month ago

Can you provide more details and screenshot or screen recording of the exact behaviour?

frech87 commented 1 month ago

From example/auth-using-api-base

  `case "passwd":

    passwd := req.URL.Query().Get("passwd")

    wa.ReceivePasswd(passwd)

    for wa.authStatus.Event == gotgproto.AuthStatusPasswordAsked ||

        wa.authStatus.Event == gotgproto.AuthStatusPasswordRetrial {

        continue

    }`

  `func (w *WebAuth) AskPassword() (string, error) {

if w.authStatus.Event == gotgproto.AuthStatusPasswordRetrial {

    fmt.Println("The 2FA password you just entered seems to be incorrect,")

    fmt.Println("Attempts Left:", w.authStatus.AttemptsLeft)

    fmt.Println("Please try again....")

}

fmt.Println("waiting for 2fa password...")

code := <-w.passwdChan

return code, nil

}`

Input otp code, response "2fa asked" and then input 2fa password, not response and waiting. When check auth status, return 2fa asked. But in telegram->setting->device I find new successfully connected devices