mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Fixed SSO login from QRcode
This commit is contained in:
parent
a99067f701
commit
5d14d8bb7b
1 changed files with 19 additions and 0 deletions
|
|
@ -38,6 +38,7 @@ import org.linphone.databinding.AssistantQrCodeScannerFragmentBinding
|
|||
import org.linphone.ui.GenericActivity
|
||||
import org.linphone.ui.GenericFragment
|
||||
import org.linphone.ui.assistant.viewmodel.QrCodeViewModel
|
||||
import org.linphone.ui.main.sso.fragment.SingleSignOnFragmentDirections
|
||||
|
||||
@UiThread
|
||||
class QrCodeScannerFragment : GenericFragment() {
|
||||
|
|
@ -98,6 +99,24 @@ class QrCodeScannerFragment : GenericFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
coreContext.bearerAuthenticationRequestedEvent.observe(viewLifecycleOwner) {
|
||||
it.consume { pair ->
|
||||
val serverUrl = pair.first
|
||||
val username = pair.second
|
||||
|
||||
Log.i(
|
||||
"$TAG Navigating to Single Sign On Fragment with server URL [$serverUrl] and username [$username]"
|
||||
)
|
||||
if (findNavController().currentDestination?.id == R.id.qrCodeScannerFragment) {
|
||||
val action = SingleSignOnFragmentDirections.actionGlobalSingleSignOnFragment(
|
||||
serverUrl,
|
||||
username
|
||||
)
|
||||
findNavController().navigate(action)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isCameraPermissionGranted()) {
|
||||
if (ActivityCompat.shouldShowRequestPermissionRationale(requireActivity(), Manifest.permission.CAMERA)) {
|
||||
Log.w("$TAG CAMERA permission wasn't granted yet, asking for it now")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue