Skip to content
Advertisement

How to handle sign up a user error while using Firebase REST API

I’ve been trying to sign up a user using Firebase Rest API using Node & Axios HTTP library.

I’m able to create a new user with email and password.

But when email already exists in the database or password is less than 6 characters, it doesn’t show the proper errors.

It just returns Request failed with status code 400

Here is my code.

JavaScript

Error I get.

JavaScript

Expected error here is : Email already exists. But it doesn’t return this error.

What could be the issue here ?

Thanks!

Advertisement

Answer

By default firebase doesn’t return response in the error body but it can be extracted with.

JavaScript

This is not mentioned in the official firebase docs.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement