gotgproto icon indicating copy to clipboard operation
gotgproto copied to clipboard

2fa password is freeze

Open frech87 opened this issue 1 year ago • 2 comments

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

frech87 avatar Aug 12 '24 13:08 frech87

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

celestix avatar Aug 13 '24 04:08 celestix

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

frech87 avatar Aug 13 '24 05:08 frech87