diff --git a/CHANGES.md b/CHANGES.md index e0a122ca69..1a373da04c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,7 +9,7 @@ Improvements 🙌: - Improve network detection. It is now based on the sync request status (#873, #882) Other changes: - - + - Support SSO login with Firefox account (#606) Bugfix 🐛: - Ask for permission before opening the camera (#934) diff --git a/vector/src/main/java/im/vector/riotx/features/login/LoginWebFragment.kt b/vector/src/main/java/im/vector/riotx/features/login/LoginWebFragment.kt index 47388653da..08d92760b2 100644 --- a/vector/src/main/java/im/vector/riotx/features/login/LoginWebFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/login/LoginWebFragment.kt @@ -83,6 +83,10 @@ class LoginWebFragment @Inject constructor( private fun setupWebView(state: LoginViewState) { loginWebWebView.settings.javaScriptEnabled = true + // Enable local storage to support SSO with Firefox accounts + loginWebWebView.settings.domStorageEnabled = true + loginWebWebView.settings.databaseEnabled = true + // Due to https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html, we hack // the user agent to bypass the limitation of Google, as a quick fix (a proper solution will be to use the SSO SDK) loginWebWebView.settings.userAgentString = "Mozilla/5.0 Google" @@ -90,7 +94,7 @@ class LoginWebFragment @Inject constructor( // AppRTC requires third party cookies to work val cookieManager = android.webkit.CookieManager.getInstance() - // clear the cookies must be cleared + // clear the cookies if (cookieManager == null) { launchWebView(state) } else { @@ -225,12 +229,8 @@ class LoginWebFragment @Inject constructor( val action = javascriptResponse.action if (state.signMode == SignMode.SignIn) { - try { - if (action == "onLogin") { - javascriptResponse.credentials?.let { notifyViewModel(it) } - } - } catch (e: Exception) { - Timber.e(e, "## shouldOverrideUrlLoading() : failed") + if (action == "onLogin") { + javascriptResponse.credentials?.let { notifyViewModel(it) } } } else { // MODE_REGISTER