Skip to content

Commit

Permalink
Merge pull request #1008 from PhenoApps/v5_976_client_id_bugfix
Browse files Browse the repository at this point in the history
v5 client id preference bugfix
  • Loading branch information
trife authored Jul 18, 2024
2 parents ff2abd5 + 3fa51d6 commit 1673e37
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public class BrapiPreferencesFragment extends PreferenceFragmentCompat implement
private NeutralButtonEditTextDialog brapiURLPreference;
private NeutralButtonEditTextDialog brapiDisplayName;
private NeutralButtonEditTextDialog brapiOIDCURLPreference;
private NeutralButtonEditTextDialog brapiClientIdPreference;

private ListPreference brapiOIDCFlow;

//old base url must be in memory now, since NeutralEditText preference updates preferences
Expand Down Expand Up @@ -152,6 +154,7 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
brapiPrefCategory = findPreference("brapi_category");
brapiLogoutButton = findPreference("revokeBrapiAuth");

brapiClientIdPreference = findPreference(GeneralKeys.BRAPI_OIDC_CLIENT_ID);
brapiURLPreference = findPreference(GeneralKeys.BRAPI_BASE_URL);
brapiDisplayName = findPreference(GeneralKeys.BRAPI_DISPLAY_NAME);
if (brapiURLPreference != null) {
Expand Down Expand Up @@ -458,6 +461,8 @@ public void onDisplayPreferenceDialog(Preference preference) {
text = (text == null || text.isEmpty()) ? getString(R.string.export_source_brapi) : text;
brapiDisplayName.setText(text);
onPreferenceChange(brapiDisplayName, text);
} else if (preference.getKey().equals(brapiClientIdPreference.getKey())) {
//pass to ensure oidc isn't updated as well, client id is automatically handled by xml definition
} else {
preferences.edit().putBoolean(GeneralKeys.BRAPI_EXPLICIT_OIDC_URL, true).apply();
brapiOIDCURLPreference.setText(text);
Expand Down

0 comments on commit 1673e37

Please sign in to comment.