set error message if google auth on client fails
This commit is contained in:
@ -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 ->"),
|
||||
|
||||
Reference in New Issue
Block a user