auth.recoverPassword
Reset the 2FA password using the recovery code sent using auth requestPasswordRecovery.
func (c *Client) AuthRecoverPassword(ctx context.Context, request *AuthRecoverPasswordRequest) (AuthAuthorizationClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.AuthRecoverPassword(ctx, &tg.AuthRecoverPasswordRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // AuthAuthorizationClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Code | string | yes | Code received via email |
NewSettings | AccountPasswordInputSettings | — | New password |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CODE_EMPTY | The provided code is empty. |
| 400 | NEW_SETTINGS_INVALID | The new password settings are invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
auth.recoverPassword#37096c70