HTTP 401 · Unauthorized
HTTP 401 Authentication

When & why it happens

2FA is enabled on this account. After SignIn returns this, call account.getPassword and complete checkPassword.

Handling in gogram

Surfaced as *gogram.ErrResponseCode. Match on the message:

if err, ok := err.(*gogram.ErrResponseCode); ok { if err.Message == "SESSION_PASSWORD_NEEDED" { // handle this error } }