Skip to content

Commit af9a63a

Browse files
tobiasKaminskyalperozturk96
authored andcommittedAug 19, 2024··
mdm only needs to provide server address
fallback to normal login Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
1 parent 08afce2 commit af9a63a

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed
 

‎.idea/inspectionProfiles/ktlint.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java

+9-5
Original file line numberDiff line numberDiff line change
@@ -317,22 +317,26 @@ protected void onCreate(Bundle savedInstanceState) {
317317
mIsFirstAuthAttempt = savedInstanceState.getBoolean(KEY_AUTH_IS_FIRST_ATTEMPT_TAG);
318318
}
319319

320-
boolean webViewLoginMethod;
320+
boolean webViewLoginMethod = false;
321321
String webloginUrl = null;
322322

323323
if (MainApp.isClientBrandedPlus()) {
324324
RestrictionsManager restrictionsManager = (RestrictionsManager) getSystemService(Context.RESTRICTIONS_SERVICE);
325325
AppConfigManager appConfigManager = new AppConfigManager(this, restrictionsManager.getApplicationRestrictions());
326-
webloginUrl = appConfigManager.getBaseUrl(MainApp.isClientBrandedPlus());
326+
327+
if (!TextUtils.isEmpty(appConfigManager.getBaseUrl(MainApp.isClientBrandedPlus()))) {
328+
webloginUrl = appConfigManager.getBaseUrl(MainApp.isClientBrandedPlus()) + WEB_LOGIN;
329+
}
327330
}
328331

329-
if (webloginUrl != null) {
332+
if (!TextUtils.isEmpty(webloginUrl)) {
330333
webViewLoginMethod = true;
331334
} else if (getIntent().getBooleanExtra(EXTRA_USE_PROVIDER_AS_WEBLOGIN, false)) {
332335
webViewLoginMethod = true;
333336
webloginUrl = getString(R.string.provider_registration_server);
334-
} else {
335-
webViewLoginMethod = !TextUtils.isEmpty(getResources().getString(R.string.webview_login_url));
337+
} else if (!TextUtils.isEmpty(getResources().getString(R.string.webview_login_url))) {
338+
webViewLoginMethod = true;
339+
webloginUrl = getResources().getString(R.string.webview_login_url);
336340
showWebViewLoginUrl = getResources().getBoolean(R.bool.show_server_url_input);
337341
}
338342

0 commit comments

Comments
 (0)
Please sign in to comment.