You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/cubit/account_cubit.dart
+6-26Lines changed: 6 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -378,16 +378,6 @@ class AccountCubit extends Cubit<AccountState> {
378
378
l.w('Unable to changeEmailAddress due to a transport error. Cannot be sure if the request was successful or not. Details: $e');
379
379
emit(AccountEmailChangeRequested(currentUser,
380
380
'Due to a network failure, we cannot say whether your request succeeded or not. We have left you signed in using your old email address but if the operation did eventually succeed, you may find that you are signed out soon. Please check your new email address for a verification request. It might take a moment to arrive but if it does, that suggests the process did work so just verify your new address, sign out of the app and then sign-in using the new email address. If unsure if it worked, sign in with your previous email address next time and try again when you have a more stable network connection.'));
381
-
382
-
//} on KeeMaybeOfflineException {
383
-
//TODO: confirm if can get a KeeMaybeOfflineException here
384
-
// l.i('Unable to authenticate since initial identification failed, probably due to a transport error. App should continue to work offline if user has previously stored their Vault.');
385
-
// final prefs = await SharedPreferences.getInstance();
final newUser =awaitUser.fromEmail(newEmailAddress);
410
-
//TODO: what is the below on about? maybe that we need to make sure that the vault is locked when we do this operation, thus ensuring that leaving the user signed in due to network faults, manipulation, etc. doesn't leave them with access to their vault data. but what about taking exports? shouldn't that be allowed? probably yes, as long as they are currently verified and can thus log in normally. then cliking the button to change email address will lock the vault and kick them to the screen that ultimately sends their request to this function.
411
-
//TODO: verify that we can only get here if Vault is already locked. Throw exception earlier if we can detect that state?
l.w('Unable to changeEmailAddress due to a 403.');
419
409
emit(AccountEmailChangeRequested(user,
420
-
'Due to an authentication problem, we were unable to change your email address. Probably it has been too long since you last signed in with your previous email address. We have left you signed in using your old email address but you may find that you are signed out soon. Please sign out and then sign in again with your previous email address and try again when you have enough time to complete the operation within 10 minutes.'));
410
+
'Due to an authentication problem, we were unable to change your email address. Probably it has been too long since you last signed in with your previous email address. Please click Cancel and then sign in again with your previous email address and try this email change again when you have enough time to complete the operation within 10 minutes.'));
421
411
} onFormatException {
422
412
// Local validation
423
413
l.i('Unable to changeEmailAddress due to FormatException.');
424
-
emit(AccountEmailChangeRequested(user, 'Please enter the correct password for your existing Kee Vault account.'));
414
+
emit(AccountEmailChangeRequested(user, 'Please enter the correct password for your Kee Vault account.'));
425
415
} onKeeInvalidRequestException {
426
416
// Local validation should mean this is unlikely to happen outside of malicious acts
427
417
l.i('Unable to changeEmailAddress due to 400 response.');
428
418
emit(AccountEmailChangeRequested(user,
429
-
'Please double check that you have entered the correct password for your existing Kee Vault account. Also check that you have entered a valid email address of no more than 70 characters.'));
419
+
'Please double check that you have entered the correct password for your Kee Vault account. Also check that you have entered a valid email address of no more than 70 characters.'));
430
420
} onKeeServerConflictException {
431
421
l.i('Unable to changeEmailAddress due to 409 response.');
432
422
emit(AccountEmailChangeRequested(user,
@@ -437,17 +427,7 @@ class AccountCubit extends Cubit<AccountState> {
437
427
} onKeeServiceTransportExceptioncatch (e) {
438
428
l.w('Unable to changeEmailAddress due to a transport error. Cannot be sure if the request was successful or not. Details: $e');
439
429
emit(AccountEmailChangeRequested(user,
440
-
'Due to a network failure, we cannot say whether your request succeeded or not. We have left you signed in using your old email address but if the operation did eventually succeed, you may find that you are signed out soon. Please check your new email address for a verification request. It might take a moment to arrive but if it does, that suggests the process did work so just verify your new address, sign out of the app and then sign-in using the new email address. If unsure if it worked, sign in with your previous email address next time and try again when you have a more stable network connection.'));
441
-
442
-
//} on KeeMaybeOfflineException {
443
-
//TODO: confirm if can get a KeeMaybeOfflineException here
444
-
// l.i('Unable to authenticate since initial identification failed, probably due to a transport error. App should continue to work offline if user has previously stored their Vault.');
445
-
// final prefs = await SharedPreferences.getInstance();
'Due to a network failure, we cannot say whether your request succeeded or not. Please check your new email address for a verification request. It might take a moment to arrive but if it does, that suggests the process did work so just verify your new address, click Cancel below and then sign-in using the new email address. If unsure if it worked, sign in with your previous email address next time and try again when you have a more stable network connection.'));
// We always sign the user out. Might be nice to send them back to their Vault if that's where they came from (i.e. they have a validated and active account) but might be hard to do securely so will ignore that edge case initially.
26
+
// We always sign the user out. Might be nice to send them back to their Vault if that's
27
+
// where they came from (i.e. they have a validated and active account) but might be
28
+
// hard to do securely so will ignore that edge case initially.
25
29
final accountCubit =BlocProvider.of<AccountCubit>(context);
0 commit comments