File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -152,4 +152,6 @@ extern NSString *const kNewsFeedStoryBoardKey;
152
152
*/
153
153
- (void ) resetAppAndProceedToSignIn ;
154
154
155
+ - (void ) clearPreviousUserData ;
156
+
155
157
@end
Original file line number Diff line number Diff line change @@ -1246,17 +1246,21 @@ - (void) resetAppAndProceedToSignIn
1246
1246
UIViewController * vc = [[UIViewController alloc ] init ];
1247
1247
vc.view .backgroundColor = [UIColor whiteColor ];
1248
1248
appDelegate.window .rootViewController = vc;
1249
-
1250
- // Clear all user info, in case they log in or sign up as a different user afterwards
1251
- [appDelegate clearNSUserDefaults ];
1252
- [APCKeychainStore resetKeyChain ];
1253
- [appDelegate.dataSubstrate resetCoreData ];
1254
-
1249
+
1255
1250
// This is all that is needed to force the re-registration of the PIN
1256
1251
APCUser* user = [((id <APCOnboardingManagerProvider>)appDelegate) onboardingManager ].user ;
1257
1252
user.secondaryInfoSaved = NO ;
1258
1253
1259
1254
[self logOutAndGoToSignIn ];
1260
1255
}
1261
1256
1257
+ - (void ) clearPreviousUserData
1258
+ {
1259
+ // Clear all user info, in case they log in or sign up as a different user afterwards
1260
+ APCAppDelegate * appDelegate = (APCAppDelegate*) [UIApplication sharedApplication ].delegate ;
1261
+ [appDelegate clearNSUserDefaults ];
1262
+ [APCKeychainStore resetKeyChain ];
1263
+ [appDelegate.dataSubstrate resetCoreData ];
1264
+ }
1265
+
1262
1266
@end
Original file line number Diff line number Diff line change @@ -177,9 +177,14 @@ - (void) signIn
177
177
178
178
APCUser * user = [self user ];
179
179
180
- user.email = self.userHandleTextField .text ;
180
+ if (user.email != nil && ![user.email isEqualToString: self .userHandleTextField.text] ) {
181
+ // Trying to log in as a different user, so clear cached data from the previously logged in user
182
+ [((APCAppDelegate*)[UIApplication sharedApplication ].delegate) clearPreviousUserData ];
183
+ }
181
184
185
+ user.email = self.userHandleTextField .text ;
182
186
user.password = self.passwordTextField .text ;
187
+
183
188
[user signInOnCompletion: ^(NSError *error) {
184
189
if (error) {
185
190
[spinnerController dismissViewControllerAnimated: YES completion: ^{
You can’t perform that action at this time.
0 commit comments