Skip to content

Commit 8ea3d7f

Browse files
Fix issue for Jetpack CP sites
`isUsingWpComRestApi` was returning false for Jetpack CP sites, leading to always ignoring saved app passwords credentials, as for WPCom rest sites, `SiteModel#username` is always null.
1 parent c7f9c85 commit 8ea3d7f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/SiteModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ public void setOrigin(@SiteOrigin int origin) {
787787
}
788788

789789
public boolean isUsingWpComRestApi() {
790-
return isWPCom() || (isJetpackConnected() && getOrigin() == ORIGIN_WPCOM_REST);
790+
return isWPCom() || getOrigin() == ORIGIN_WPCOM_REST;
791791
}
792792

793793
public void setSpaceAvailable(long spaceAvailable) {

libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpapi/applicationpasswords/ApplicationPasswordsStore.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ApplicationPasswordsStore @Inject constructor(
3939
val uuid = encryptedPreferences.getString(site.uuidPrefKey, null)
4040

4141
return when {
42-
!site.isUsingWpComRestApi && site.username != username -> null
42+
site.username != username && !site.isUsingWpComRestApi -> null
4343
username != null && password != null ->
4444
ApplicationPasswordCredentials(
4545
userName = username,

0 commit comments

Comments
 (0)