-
Notifications
You must be signed in to change notification settings - Fork 731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/bma/OIDC session end #8620
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments inline.
Also, as per internal discussion, we might need to change the wording/have an interstitial after pressing Sign Out.
if (otherDevices.isNullOrEmpty()) { | ||
hideOtherSessionsView() | ||
} else { | ||
views.deviceListHeaderOtherSessions.isVisible = true | ||
val colorDestructive = colorProvider.getColorFromAttribute(R.attr.colorError) | ||
val multiSignoutItem = views.deviceListHeaderOtherSessions.menu.findItem(R.id.otherSessionsHeaderMultiSignout) | ||
// Hide multi signout if we have an external account manager | ||
multiSignoutItem.isVisible = state.externalAccountManagementUrl == null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because delegated OIDC can be enabled on the homeserver, but the homeserver does not have to provide an external account managemnt URL this should be tried to a new property like HomeServerCapabilities.delegatedOidcAuthEnabled
.
See https://github.com/vector-im/element-android/pull/8627/files#r1305379005 for more context.
views.deviceListHeaderCurrentSession.isVisible = true | ||
val colorDestructive = colorProvider.getColorFromAttribute(R.attr.colorError) | ||
val signoutSessionItem = views.deviceListHeaderCurrentSession.menu.findItem(R.id.currentSessionHeaderSignout) | ||
signoutSessionItem.setTextColor(colorDestructive) | ||
val signoutOtherSessionsItem = views.deviceListHeaderCurrentSession.menu.findItem(R.id.currentSessionHeaderSignoutOtherSessions) | ||
signoutOtherSessionsItem.setTextColor(colorDestructive) | ||
signoutOtherSessionsItem.isVisible = hasOtherDevices | ||
// Hide signout other sessions if we have an external account manager | ||
signoutOtherSessionsItem.isVisible = hasOtherDevices && state.externalAccountManagementUrl == null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto should be linked to HomeServerCapabilities.delegatedOidcAuthEnabled
.
@@ -103,10 +103,15 @@ class OtherSessionsFragment : | |||
val nbDevices = viewState.devices()?.size ?: 0 | |||
stringProvider.getQuantityString(R.plurals.device_manager_other_sessions_multi_signout_all, nbDevices, nbDevices) | |||
} | |||
multiSignoutItem.isVisible = if (viewState.isSelectModeEnabled) { | |||
viewState.devices.invoke()?.any { it.isSelected }.orFalse() | |||
multiSignoutItem.isVisible = if (viewState.externalAccountManagementUrl != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto should be linked to HomeServerCapabilities.delegatedOidcAuthEnabled
.
We do not need an external account management URL, which is optional, but we need to know if account management is delegate to Oidc.
@hughns I have updated the PR, but I do not understand, on my emulator, the Realm migration is running well, but then the field in the Realm entity are always null. Even when reverting the change (and doing a fresh install), the code does not work. Can you try on your side with the latest version from this branch? Thanks. |
SonarCloud Quality Gate failed. 0 Bugs 0.0% Coverage The version of Java (11.0.20.1) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
I don't have an existing install to test with, but I've done a new install and it is working for me as I would expect. 🤷♂️ |
OK, let's merge this then. |
Type of change
Content
If an external account manager is configured on the server, use it to delete other session.
Note that the session Id is provided, but the web page does not use it. This is out of scope of this PR to fix that.
Also in this case, hide the delete all other sessions menu entries.
Motivation and context
Closes #8616
Screenshots / GIFs
Tests
Tested devices
Checklist