Unable to register a user using Firebase mail and password. I did everything as stated in the official documentation, but xcode gives this type of error "The email address is already in use by another account". I tried with other mailboxes, but the problem is the same. I registered the user in the database, but with his mail and password I cannot even enter the unit, and I don’t receive any errors. Here is my code ...

Can anyone come across a similar, tell me what the problem is, I will be very grateful!

//вход [[FIRAuth auth] signInWithEmail:self.userNameTextField.text password:self.passwordTextField.text completion:^(FIRUser * _Nullable user, NSError * _Nullable error) { if (!error) { } else { NSLog(@"Error %@", error.localizedDescription); } }]; //регистрация NSString *email = self.emailRegistrationTextField.text; NSString *password = self.passwordRegistrationTextField.text; [[FIRAuth auth] createUserWithEmail:email password:password completion:^(FIRUser * _Nullable user, NSError * _Nullable error) { if (!error) { self.fireUser = [[TSFireUser alloc] initWithDictionary:(NSDictionary *)user]; } else { NSLog(@"Error - %@", error.localizedDescription); } }]; 

In the AppDeldegate.m file, initialized the protocol [FIRApp configure]; all modules connected ...

    1 answer 1

    The problem is that you have to check whether the user is logged in or not. Use the currentUser property of FIRAuth. (If it is not nil then the user has already entered, otherwise, not yet). To exit, you must use the logOut method of FIRAuth.