Skip to content

Commit

Permalink
(#66) Added Biometrics authentication with fingerprint
Browse files Browse the repository at this point in the history
  • Loading branch information
MuindiStephen committed Jun 24, 2024
1 parent 933f888 commit 254974a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class SignInDetailsWithEmailFragment : Fragment() {
val biometricManager = BiometricManager.from(requireContext())
when(biometricManager.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_STRONG)) {
BiometricManager.BIOMETRIC_SUCCESS -> {
Timber.tag("Biometric").e("Authenticate using biometrics")
Timber.tag("Biometric").e("Authenticated using biometrics")
val prompt = createBiometricPrompt()
prompt.authenticate(createPromptInfo())
}
Expand Down Expand Up @@ -156,6 +156,8 @@ class SignInDetailsWithEmailFragment : Fragment() {
super.onAuthenticationSucceeded(result)
Timber.tag(this.toString()).d("Authentication was successful")
toast("Authenticated with biometrics successfully")

navigateHome()
// showEncryptedMessage(result.cryptoObject)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ class HomeDashboardFragment : Fragment() {
firebaseAuth = FirebaseAuth.getInstance()

val userId = firebaseAuth!!.uid

if (userId == null) {
Timber.e("Firebase User ID is null")
return binding.root
}
val currentUserLogged = firebaseAuth!!.currentUser

databaseReference = FirebaseDatabase.getInstance().getReference("users").child(userId!!)
Expand Down

0 comments on commit 254974a

Please sign in to comment.