mirror of
https://github.com/wrwrabbit/Partisan-Telegram-Android.git
synced 2026-05-05 23:51:00 +00:00
fix two step verification on login
This commit is contained in:
parent
7ba7f0fa77
commit
048617189a
8 changed files with 12 additions and 26 deletions
|
|
@ -397,28 +397,14 @@ public class LoginActivity extends BaseFragment {
|
|||
AndroidUtilities.runOnUIThread(() -> needFinishActivity(afterSignup, showSetPasswordConfirm, otherwiseRelogin));
|
||||
} else {
|
||||
AndroidUtilities.runOnUIThread(() -> {
|
||||
TwoStepVerificationActivity.initPasswordNewAlgo(password);
|
||||
if (!getUserConfig().hasSecureData && password.has_secure_values) {
|
||||
getUserConfig().hasSecureData = true;
|
||||
getUserConfig().saveConfig(false);
|
||||
Context context = getParentActivity();
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setTitle(LocaleController.getString("TwoStepVerificationWarningTitle", R.string.TwoStepVerificationWarningTitle));
|
||||
builder.setMessage(LocaleController.getString("TwoStepVerificationWarningMessage", R.string.TwoStepVerificationWarningMessage));
|
||||
builder.setPositiveButton(LocaleController.getString("Agree", R.string.Agree), (dialog, whitch) -> {
|
||||
int type;
|
||||
if (TextUtils.isEmpty(password.email_unconfirmed_pattern)) {
|
||||
type = TwoStepVerificationSetupActivity.TYPE_INTRO;
|
||||
} else {
|
||||
type = TwoStepVerificationSetupActivity.TYPE_EMAIL_CONFIRM;
|
||||
}
|
||||
TwoStepVerificationSetupActivity passwordFragment = new TwoStepVerificationSetupActivity(type, password);
|
||||
passwordFragment.returnToSettings = false;
|
||||
needFinishActivity(afterSignup, showSetPasswordConfirm, otherwiseRelogin, passwordFragment);
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Decline", R.string.Decline), (dialog, whitch) -> {
|
||||
needFinishActivity(afterSignup, showSetPasswordConfirm, otherwiseRelogin);
|
||||
});
|
||||
builder.setPositiveButton(LocaleController.getString(R.string.OK), null);
|
||||
showDialog(builder.create());
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue