Commit 002a800e authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Clear the cookies always the webview is opened.

parent 27b77fd4
......@@ -40,12 +40,15 @@ class OauthWebViewActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_web_view)
webPageUrl = intent.getStringExtra(INTENT_WEB_PAGE_URL)
requireNotNull(webPageUrl) { "no web_page_url provided in Intent extras" }
state = intent.getStringExtra(INTENT_STATE)
requireNotNull(state) { "no state provided in Intent extras" }
// Ensures that the cookies is always removed when opening the webview.
CookieManager.getInstance().removeAllCookies(null)
setupToolbar()
}
......@@ -57,11 +60,6 @@ class OauthWebViewActivity : AppCompatActivity() {
}
}
override fun onDestroy() {
super.onDestroy()
CookieManager.getInstance().removeAllCookies(null)
}
override fun onBackPressed() {
if (web_view.canGoBack()) {
web_view.goBack()
......
......@@ -42,6 +42,8 @@ class SsoWebViewActivity : AppCompatActivity() {
casToken = intent.getStringExtra(INTENT_SSO_TOKEN)
requireNotNull(casToken) { "no cas_token provided in Intent extras" }
// Ensures that the cookies is always removed when opening the webview.
CookieManager.getInstance().removeAllCookies(null)
setupToolbar()
}
......@@ -53,11 +55,6 @@ class SsoWebViewActivity : AppCompatActivity() {
}
}
override fun onDestroy() {
super.onDestroy()
CookieManager.getInstance().removeAllCookies(null)
}
override fun onBackPressed() {
if (web_view.canGoBack()) {
web_view.goBack()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment