how to get firebase token with angular, with firebase authentication sdk?

i am trying to create project in angular, i am using firebase sdk to get token. i’m following the documentation and i’m using the "firebase" package: "^9.17.2", I can authenticate, but I can’t extract the token from the response. this is the code i use: `signInWithEmailAndPassword(auth, "email", "pwd") .then((userCredential) => { return userCredential; // Signed… Read More how to get firebase token with angular, with firebase authentication sdk?

Flutter Null Check Operator used on a null value Firebase Auth

I am getting null check operator used on a null value error when using signout function. Basically if i comment this line out // final user = FirebaseAuth.instance.currentUser!; it works fine but the signout doesn’t work. In short, i want my ui to show with signout function. Error Image Error Screenshot Expected Output Expected output… Read More Flutter Null Check Operator used on a null value Firebase Auth

How to directly Send User to HomePage after SignIn (Signup) is successful- flutter firebase

Here is my Code RoundedElevatedButton( child: const Text("Sign in"), onPress: () async { try { await FirebaseAuth.instance .signInWithEmailAndPassword(email: email, password: password); } catch (e) { print(e.runtimeType); } }); I want To send the user to the homepage directly after login succeeds >Solution : Modify the onPress function as follows: onPress: () async { try {… Read More How to directly Send User to HomePage after SignIn (Signup) is successful- flutter firebase

Prevent Firebase Auth from creating multiple users with the same email from different providers

I have Email/Password & Google enabled as providers. I’m able to create a user with both providers and as a result I have two users with the same identifier (email) in Firebase. I need the identifier to be unique. An answer in a rather old but same question on Stack Overflow says to: Step 1… Read More Prevent Firebase Auth from creating multiple users with the same email from different providers

Is it possible to store username in FirebaseAuth.instance.currentUser in firestore flutter?

I want to store user information. Right now I created a collection Users with an email, an username and a profile image. I can get all this data using a method Future<CloudUser> getUserDetails({required String userId});. Is it possible to store the username in the class FirebaseAuth.instance.currentUser? so I don’t have to use the method getUserDetails… Read More Is it possible to store username in FirebaseAuth.instance.currentUser in firestore flutter?

showing CircularProgressIndicator until the function end | flutter

I want to show CircularProgressIndicator until the function end, So I use this method, set bool isLoading = false; and this is the function, verifyPhoneNumber(String input) async { setState(() { isLoading = true; }); await AuthMethods().phoneSign(context, input); setState(() { isLoading = false; });} For this screen Scaffold( body: isLoading ? Center( child: CircularProgressIndicator(color: darkblueColor), )… Read More showing CircularProgressIndicator until the function end | flutter

How to catch a firebase authentication multiple updates for flutter

I have this code here and I want to catch any exception if an error happens to either of these 2. final user = FirebaseAuth.instance.currentUser!; try { user.updateEmail(newEmail.text); user.updatePassword(newPassword.text); print("success"); } on FirebaseAuthException catch (e) { print("error"); } problem is, it is not recognizing the error and just goes and print "success". How do I… Read More How to catch a firebase authentication multiple updates for flutter