mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-11-04 12:28:25 +00:00 
			
		
		
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			00948ffd73
			...
			8a8a931e66
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					8a8a931e66 | ||
| 
						 | 
					148a97cd32 | 
@ -31,7 +31,6 @@ import android.net.Uri;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import com.owncloud.android.lib.common.accounts.AccountUtils;
 | 
					import com.owncloud.android.lib.common.accounts.AccountUtils;
 | 
				
			||||||
import com.owncloud.android.lib.common.authentication.OwnCloudCredentials;
 | 
					import com.owncloud.android.lib.common.authentication.OwnCloudCredentials;
 | 
				
			||||||
import com.owncloud.android.lib.common.http.HttpClient;
 | 
					 | 
				
			||||||
import timber.log.Timber;
 | 
					import timber.log.Timber;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.io.IOException;
 | 
					import java.io.IOException;
 | 
				
			||||||
@ -124,6 +123,24 @@ public class SingleSessionManager {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            Timber.v("reusing client for account %s", accountName);
 | 
					            Timber.v("reusing client for account %s", accountName);
 | 
				
			||||||
 | 
					            if (client.getAccount() != null &&
 | 
				
			||||||
 | 
					                    client.getAccount().getCredentials() != null &&
 | 
				
			||||||
 | 
					                    (client.getAccount().getCredentials().getAuthToken() == null || client.getAccount().getCredentials().getAuthToken().isEmpty())
 | 
				
			||||||
 | 
					            ) {
 | 
				
			||||||
 | 
					                Timber.i("Client " + client.getAccount().getName() + " needs to refresh credentials");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                //the next two lines are a hack because okHttpclient is used as a singleton instead of being an
 | 
				
			||||||
 | 
					                //injected instance that can be deleted when required
 | 
				
			||||||
 | 
					                client.clearCookies();
 | 
				
			||||||
 | 
					                client.clearCredentials();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                client.setAccount(account);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                account.loadCredentials(context);
 | 
				
			||||||
 | 
					                client.setCredentials(account.getCredentials());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                Timber.i("Client " + account.getName() + " with credentials size" + client.getAccount().getCredentials().getAuthToken().length());
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            reusingKnown = true;
 | 
					            reusingKnown = true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user