SRP: Redirect to Recover password page

This commit is contained in:
Neeraj Gupta 2023-07-18 17:58:45 +05:30
parent 0206752de7
commit 351a699919
2 changed files with 12 additions and 3 deletions

View file

@ -30,6 +30,7 @@ import 'package:photos/ui/account/login_page.dart';
import 'package:photos/ui/account/ott_verification_page.dart';
import 'package:photos/ui/account/password_entry_page.dart';
import 'package:photos/ui/account/password_reentry_page.dart';
import "package:photos/ui/account/recovery_page.dart";
import 'package:photos/ui/account/two_factor_authentication_page.dart';
import 'package:photos/ui/account/two_factor_recovery_page.dart';
import 'package:photos/ui/account/two_factor_setup_page.dart';
@ -303,7 +304,9 @@ class UserService {
}
}
Future<void> verifyEmail(BuildContext context, String ott) async {
Future<void> verifyEmail(BuildContext context, String ott, {bool
isResettingPasswordScreen = false,})
async {
final dialog = createProgressDialog(context, S.of(context).pleaseWait);
await dialog.show();
try {
@ -324,7 +327,12 @@ class UserService {
} else {
await _saveConfiguration(response);
if (Configuration.instance.getEncryptedToken() != null) {
if(isResettingPasswordScreen) {
page = const RecoveryPage();
} else {
page = const PasswordReentryPage();
}
} else {
page = const PasswordEntryPage(mode: PasswordEntryMode.set,);
}

View file

@ -79,7 +79,8 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
);
} else {
UserService.instance
.verifyEmail(context, _verificationCodeController.text);
.verifyEmail(context, _verificationCodeController.text,
isResettingPasswordScreen: widget.isResetPasswordScreen,);
}
FocusScope.of(context).unfocus();
},