linked: clear cookies and don't save form data in oauth webview

This commit is contained in:
Vincent Breitmoser
2015-09-06 00:59:06 +02:00
parent 31cfbdc5d2
commit 8e60bf70a1

View File

@@ -423,7 +423,7 @@ public class LinkedIdCreateGithubFragment extends CryptoOperationFragment<SaveKe
final Dialog auth_dialog = new Dialog(activity);
auth_dialog.setContentView(R.layout.oauth_webview);
WebView web = (WebView) auth_dialog.findViewById(R.id.web_view);
web.getSettings().setJavaScriptEnabled(true);
web.getSettings().setSaveFormData(false);
web.setWebViewClient(new WebViewClient() {
boolean authComplete = false;
@@ -445,6 +445,10 @@ public class LinkedIdCreateGithubFragment extends CryptoOperationFragment<SaveKe
Log.d(Constants.TAG, "got ok response, code is " + mOAuthCode);
CookieManager cookieManager = CookieManager.getInstance();
// noinspection deprecation (replacement is api lvl 21)
cookieManager.removeAllCookie();
auth_dialog.dismiss();
return true;
}