Skip to content

Commit

Permalink
Merge pull request #21 from faiyaz103/bishal
Browse files Browse the repository at this point in the history
singleton added
  • Loading branch information
IronDigger098 authored May 28, 2024
2 parents b3bb1c6 + 1c605e6 commit 12ea2ca
Showing 1 changed file with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,26 @@ public static synchronized FirebaseAuthSingleton getInstance() {
public FirebaseAuth getFirebaseAuth() {
return firebaseAuth;
}
}
public void signIn(String email, String password, onSignInListener listener) {
firebaseAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(task -> {
if (task.isSuccessful()) {
listener.onSignInSuccess();
} else {
// Login failed
listener.onSignInFailed(task.getException().getMessage());
}
});
}

public void signOut() {
firebaseAuth.signOut();
}



public interface onSignInListener {
void onSignInSuccess();
void onSignInFailed(String errorMessage);
}

}

0 comments on commit 12ea2ca

Please sign in to comment.