Skip to main content

account.updatePasswordSettings

Set a new 2FA password

func (c *Client) AccountUpdatePasswordSettings(ctx context.Context, request *AccountUpdatePasswordSettingsRequest) (bool, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.AccountUpdatePasswordSettings(ctx, &tg.AccountUpdatePasswordSettingsRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})

Parameters

NameTypeRequiredDescription
PasswordInputCheckPasswordSRPClassyesThe old password (see SRP)
NewSettingsAccountPasswordInputSettingsyesThe new password (see SRP)

Returns

bool

Possible errors

CodeTypeDescription
400EMAIL_INVALIDThe specified email is invalid.
400EMAIL_UNCONFIRMEDEmail unconfirmed.
400NEW_SALT_INVALIDThe new salt is invalid.
400NEW_SETTINGS_EMPTYNo password is set on the current account, and no new password was specified in new_settings.
400NEW_SETTINGS_INVALIDThe new password settings are invalid.
400PASSWORD_HASH_INVALIDThe provided password hash is invalid.
400SRP_ID_INVALIDInvalid SRP ID provided.
400SRP_PASSWORD_CHANGEDPassword has changed.

References