Skip to content

Commit

Permalink
catch if user cancelled from the web page cancel button
Browse files Browse the repository at this point in the history
  • Loading branch information
ktiniatros committed Jul 28, 2022
1 parent c5ea745 commit 2d4ea3b
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 2d4ea3b

Please sign in to comment.