Use login v2 flow

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-04-23 16:53:47 +02:00 committed by Alper Öztürk
parent 3cb64465d9
commit 987e8e3705
1 changed files with 7 additions and 4 deletions

View File

@ -973,8 +973,11 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
accountSetupWebviewBinding = AccountSetupWebviewBinding.inflate(getLayoutInflater());
setContentView(accountSetupWebviewBinding.getRoot());
anonymouslyPostLoginRequest(mServerInfo.mBaseUrl + WEB_LOGIN);
// initWebViewLogin(mServerInfo.mBaseUrl + WEB_LOGIN, false);
if (!isLoginProcessCompleted) {
anonymouslyPostLoginRequest(mServerInfo.mBaseUrl + WEB_LOGIN);
// initWebViewLogin(mServerInfo.mBaseUrl + WEB_LOGIN, false);
}
}
} else {
updateServerStatusIconAndText(result);
@ -1572,7 +1575,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
Log_OC.d(TAG, "performLoginV2 response: " + response);
if (!response.isEmpty()) {
completeLoginFlow(response);
isLoginProcessCompleted = true;
runOnUiThread(() -> completeLoginFlow(response));
}
}
@ -1595,7 +1599,6 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
mServerInfo.mBaseUrl = AuthenticatorUrlUtils.INSTANCE.normalizeUrlSuffix(loginUrlInfo.serverAddress);
webViewUser = loginUrlInfo.username;
webViewPassword = loginUrlInfo.password;
isLoginProcessCompleted = true;
} catch (Exception e) {
Log_OC.d(TAG, "Error caught at completeLoginFlow: " + e);
mServerStatusIcon = R.drawable.ic_alert;