Skip to content

Commit

Permalink
Merge pull request #1360 from minvws/4679
Browse files Browse the repository at this point in the history
catch if user cancelled from the web page cancel button
  • Loading branch information
ktiniatros authored Jul 29, 2022
2 parents c5ea745 + 2d4ea3b commit 57237a9
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class LoginViewModel(
const val NETWORK_ERROR = 3
const val LOGIN_REQUIRED_ERROR = "login_required"
const val SAML_AUTHN_FAILED_ERROR = "saml_authn_failed"
const val CANCELLED = "cancelled"
}

val loading: LiveData<Event<Boolean>> = MutableLiveData()
Expand Down Expand Up @@ -124,6 +125,7 @@ class LoginViewModel(
private fun isUserCancelled(authError: AuthorizationException) =
(authError.type == AuthorizationException.TYPE_GENERAL_ERROR && authError.code == USER_CANCELLED_FLOW_CODE)
|| authError.error == SAML_AUTHN_FAILED_ERROR
|| authError.error == CANCELLED

private suspend fun postAuthResponseResult(
loginType: LoginType,
Expand Down

0 comments on commit 57237a9

Please sign in to comment.