Skip to content

Commit

Permalink
➕ add 2FA msg : #98
Browse files Browse the repository at this point in the history
  • Loading branch information
theapache64 committed Feb 27, 2024
1 parent f6a8ff3 commit ac2c39d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ class AuthRepo @Inject constructor(
emit(Resource.Success(account))
} catch (e: Exception) {
e.printStackTrace()
emit(Resource.Error(e.message ?: "Something went wrong"))
val userFriendlyMsg = when (e.message) {
"NeedsBrowser" -> "Looks like you've 2FA enabled. Please disable it and try again"
else -> e.message
}
emit(Resource.Error(userFriendlyMsg ?: "Something went wrong"))
}
}
}
Expand Down

0 comments on commit ac2c39d

Please sign in to comment.