Created
October 3, 2023 06:09
-
-
Save whytarun/a10b3110114f4726bb1fac29146a8e97 to your computer and use it in GitHub Desktop.
Implementing Firebase Authentication for user authentication.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FirebaseAuth mAuth = FirebaseAuth.getInstance(); | |
// Sign in with email and password | |
mAuth.signInWithEmailAndPassword(email, password) | |
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { | |
@Override | |
public void onComplete(@NonNull Task<AuthResult> task) { | |
if (task.isSuccessful()) { | |
// User is authenticated | |
} else { | |
// Authentication failed | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment