File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1294,6 +1294,7 @@ private Task<Void> linkWithAsync(
12941294 public Task <Void > then (Task <Void > task ) throws Exception {
12951295 synchronized (mutex ) {
12961296 if (task .isFaulted () || task .isCancelled ()) {
1297+ removeAuthData (authType );
12971298 restoreAnonymity (oldAnonymousData );
12981299 return task ;
12991300 }
Original file line number Diff line number Diff line change @@ -699,13 +699,13 @@ public void testlinkWithInBackgroundWithSaveAsyncFailure() throws Exception {
699699 partialMockUser .linkWithInBackground (authType , authData );
700700 linkTask .waitForCompletion ();
701701
702- // Make sure new authData is added
703- assertSame (authData , partialMockUser .getAuthData ().get (authType ));
704702 // Make sure we save the user
705703 verify (partialMockUser , times (1 ))
706704 .saveAsync (eq ("sessionTokenAgain" ), eq (false ), Matchers .<Task <Void >>any ());
707705 // Make sure old authData is restored
708706 assertSame (anonymousAuthData , partialMockUser .getAuthData ().get (ParseAnonymousUtils .AUTH_TYPE ));
707+ // Make sure failed new authData is cleared
708+ assertNull (partialMockUser .getAuthData ().get ("facebook" ));
709709 // Verify exception
710710 assertSame (saveException , linkTask .getError ());
711711 }
You can’t perform that action at this time.
0 commit comments