mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
set error message if google auth on client fails
This commit is contained in:
parent
80f91d42bf
commit
5be9c4de23
3 changed files with 14 additions and 7 deletions
|
|
@ -36,6 +36,8 @@ fun GoogleAuthButton(viewModel: LoginViewModel) {
|
|||
val task: Task<GoogleSignInAccount> = GoogleSignIn.getSignedInAccountFromIntent(intent)
|
||||
viewModel.handleGoogleAuthTask(task)
|
||||
}
|
||||
} else {
|
||||
viewModel.showGoogleErrorMessage()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,10 @@ class LoginViewModel @Inject constructor(
|
|||
errorMessage = null
|
||||
}
|
||||
|
||||
fun showGoogleErrorMessage() {
|
||||
errorMessage = "Failed to authenticate with Google."
|
||||
}
|
||||
|
||||
fun handleGoogleAuthTask(task: Task<GoogleSignInAccount>) {
|
||||
val googleIdToken = task?.getResult(ApiException::class.java).idToken
|
||||
Log.d(ContentValues.TAG, "Google Result?: $googleIdToken")
|
||||
|
|
|
|||
|
|
@ -131,13 +131,14 @@ fun AuthProviderView(
|
|||
GoogleAuthButton(viewModel)
|
||||
}
|
||||
|
||||
LoadingButtonWithIcon(
|
||||
text = "Continue with Apple",
|
||||
loadingText = "Signing in...",
|
||||
icon = painterResource(id = R.drawable.ic_logo_apple),
|
||||
modifier = Modifier.padding(vertical = 6.dp),
|
||||
onClick = {}
|
||||
)
|
||||
// Disable apple auth for now
|
||||
// LoadingButtonWithIcon(
|
||||
// text = "Continue with Apple",
|
||||
// loadingText = "Signing in...",
|
||||
// icon = painterResource(id = R.drawable.ic_logo_apple),
|
||||
// modifier = Modifier.padding(vertical = 6.dp),
|
||||
// onClick = {}
|
||||
// )
|
||||
|
||||
ClickableText(
|
||||
text = AnnotatedString("Continue with Email ->"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue