Skip to content

Commit

Permalink
Fix for users not staying logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
doubleangels committed Jan 5, 2025
1 parent 4e1c3d0 commit 1b3b29d
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,20 +191,19 @@ public void setupWebViewForActivity(String url) {
webViewSettings.setCacheMode(WebSettings.LOAD_DEFAULT);
webViewSettings.setAllowFileAccess(false);
webViewSettings.setAllowContentAccess(false);
// Allow cookies so that user can stay logged in
webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView webView, String url) {
CookieManager.getInstance().setAcceptCookie(true);
CookieManager.getInstance().acceptCookie();
CookieManager.getInstance().flush();
}
});
if (Boolean.TRUE.equals(darkModeEnabled)) {
if (WebViewFeature.isFeatureSupported(WebViewFeature.ALGORITHMIC_DARKENING)) {
WebSettingsCompat.setAlgorithmicDarkeningAllowed(webView.getSettings(), true);
}
} else {
// Allow cookies so that user can stay logged in
webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView webView, String url) {
CookieManager.getInstance().setAcceptCookie(true);
CookieManager.getInstance().acceptCookie();
CookieManager.getInstance().flush();
}
});
}
// Setup DownloadManager for handling file downloads
setupDownloadManagerForActivity();
Expand Down

0 comments on commit 1b3b29d

Please sign in to comment.