Relative Content

Tag Archive for firebasekotlinandroid-jetpack-compose

How to handle both user does not exist and wrong password cases differently in firebase Jetpack compose

override suspend fun signIn(email: String, password: String): Flow<Response<Boolean>> = callbackFlow { try { auth.signInWithEmailAndPassword(email, password) .addOnCompleteListener { task -> if (task.isSuccessful) { trySend(Response.Success(true)) val user = auth.currentUser } else{ try { throw task.exception!! } catch (e: FirebaseAuthInvalidCredentialsException){ trySend(Response.Failure(e)) } } } trySend(Response.Loading) } catch (e:Exception){ trySend(Response.Failure(e)) } awaitClose { } } I want to handle […]