Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebase call returns http post failure in addition to error message when registering a user that already exists #166

Closed
fearonf opened this issue May 31, 2017 · 3 comments

Comments

@fearonf
Copy link

fearonf commented May 31, 2017

The code calling Firebase is:

var email = vm.username;
var password = vm.password;

                firebase.auth().createUserWithEmailAndPassword(email, password).then(function(){
                    console.log("user created in firebase");

                    //Create a new user in the secur database too, for user profile

                     $http.post('/api/users/register',user).then(function(result) {
                         console.log("User profile added to secur database too")
                         console.log(result);
                         vm.message = 'Successful registration, please login.';

                     }).catch(function(error) {
                         console.log(error);

                     })

                }) .catch(function (error) {
                    // Handle Errors here.
                    var errorCode = error.code;
                    var errorMessage = error.message;

             
                    vm.error = errorMessage;
                    vm.message='';
                    console.log(vm.error);

                });

Input: a@b.c password: aaaaaa
When error returned is 'the email address is badly formatted' , just the message is returned in the console log:
The email address is badly formatted.

Input: a@gmail.com password: aaaaaa
when error returned is 'The email address is already in use by another account.' the following is logged in the console:
POST https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=*********************** 400 ()
register-controller.js:67 The email address is already in use by another account.

@nicolasgarnier
Copy link
Contributor

@fearonf could you tell me what samples is impacted here? :)

@gghanshyam01
Copy link

Having same issue. Can't understand what is going wrong

@jhuleatt
Copy link
Collaborator

Closing since nobody has provided info on which sample this happens in. If someone has more evidence of this issue, feel free to comment and I can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants