Open TonySeedy opened 3 years ago
i need this method too
Did you find a solution how to use 2FA Auth?
try { await RequestWithDcMigration(request, token).ConfigureAwait(false); } catch (CloudPasswordNeededException ex) { if (password != "") { requestCheckPassword = new TLRequestCheckPassword { Password = await SRPHelper.CheckPassword(this, password, token) }; await RequestWithDcMigration(requestCheckPassword, token).ConfigureAwait(false); } else throw ex; }
if (requestCheckPassword == null && request.Response is TLAuthorization)
{
OnUserAuthenticated(((TLUser)((TLAuthorization)request.Response).User));
return ((TLUser)((TLAuthorization)request.Response).User);
}
else if (requestCheckPassword != null && requestCheckPassword.Response is TLAuthorization)
{
OnUserAuthenticated(((TLUser)((TLAuthorization)requestCheckPassword.Response).User));
return ((TLUser)((TLAuthorization)requestCheckPassword.Response).User);
}
else
{
var signUpRequest = new TLRequestSignUp() { PhoneNumber = phoneNumber, PhoneCodeHash = phoneCodeHash, FirstName = firstName, LastName = lastName };
await RequestWithDcMigration(signUpRequest, token).ConfigureAwait(false);
OnUserAuthenticated((TLUser)signUpRequest.Response.User);
return (TLUser)signUpRequest.Response.User;
}
@atrezonator Thx, for your answer. Do I need to paste this in MakeAuthAsync Method or I need to create new MakeAuthWithPasswordAsync Method and paste this code? Btw. TgSharp does not have SRPHelper Class.
Hello everyone I did not found MakeAuthWithPasswordAsync method I cant login 2fa without AuthPassword Did you change it or move it to another class that I can't find? i tried change like TLSharp version but it doesn't work in TG