Здравствуйте подскажите как я могу привязать почту при установке 2FA авторизации.
Сейчас я получаю ошибку PASSWORD_HASH_INVALID
public async Task SetTwoAutorize()
{
try
{
// const string old_password = "password"; // current password if any (unused otherwise)
const string new_password = "new_pass"; // or null to disable 2FA
var accountPwd = await _Client.Account_GetPassword();
// var password = accountPwd.current_algo == null ? null : await Client.InputCheckPassword(accountPwd, old_password);
var password = accountPwd.current_algo == null ? null : await Client.InputCheckPassword(accountPwd, new_password);
accountPwd.current_algo = null; // makes InputCheckPassword generate a new password
var new_password_hash = new_password == null ? null : await Client.InputCheckPassword(accountPwd, new_password);
await _Client.Account_UpdatePasswordSettings(password, new Account_PasswordInputSettings
{
email = "my_email",
flags = Account_PasswordInputSettings.Flags.has_email,
new_password_hash = new_password_hash?.A,
new_algo = accountPwd.new_algo,
});
}
catch (Exception e)
{
string code = "";
await _Client.Account_ConfirmPasswordEmail(code);
}
}
I tried to follow this pattern https://corefork.telegram.org/method/account.updatePasswordSettings But it didn’t work out.