Skip to content

2FA authentication not working #344

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

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class CaptchaFragment : Fragment(), LoginNavigator {
}

override fun openSessionLimitReachedDialogue(error: SessionErrorResponse) {
viewModel.sessionError = error
setNavigationResultBoolean(true, "session_limit_dialogue")
findNavController().popBackStack()
}
Expand Down
6 changes: 6 additions & 0 deletions core/src/main/java/net/ivpn/core/v2/login/LoginFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import net.ivpn.core.IVPNApplication
import net.ivpn.core.R
import net.ivpn.core.common.billing.addfunds.Plan
import net.ivpn.core.common.extension.findNavControllerSafely
import net.ivpn.core.common.extension.getNavigationResultBoolean
import net.ivpn.core.common.extension.navigate
import net.ivpn.core.databinding.FragmentLoginBinding
import net.ivpn.core.rest.data.session.SessionErrorResponse
Expand Down Expand Up @@ -154,6 +155,11 @@ class LoginFragment : Fragment(), LoginNavigator,
binding.contentLayout.qrCode.setOnClickListener {
openQRScanner()
}
getNavigationResultBoolean("session_limit_dialogue")?.observe(viewLifecycleOwner) {
if (it) {
viewModel.sessionError?.let { it1 -> openSessionLimitReachedDialogue(it1) }
}
}
}

private fun initToolbar() {
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/net/ivpn/core/v2/login/LoginViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ class LoginViewModel @Inject constructor(
var pendingCaptcha: String? = null
var pending2FAToken: String? = null

var sessionError: SessionErrorResponse? = null

var tfaFocusListener = View.OnFocusChangeListener { _, hasFocus ->
if (hasFocus) {
tfaInputState.get()?.let {
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/net/ivpn/core/v2/tfa/TFAFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ class TFAFragment : Fragment(), LoginNavigator {
}

override fun openSessionLimitReachedDialogue(error: SessionErrorResponse) {
viewModel.sessionError = error
setNavigationResultBoolean(true, "session_limit_dialogue")
findNavController().popBackStack()
}
Expand Down
Loading