Handling Error Response from Firebase Auth

Hello,

I am doing an HTTP request to interact with firesbase auth.

I would like to be able to take the "message" : string "TEXT" and assign the "TEXT" to a variable to evaluate and do with as I please. I do not know how to address it though.

This is what firebase says i should get:
image

and this is what I get. looks good so far.
image

I get this or similar back from the parsed response body from the HTTP request.
{"error":{"code":400,"message":"EMAIL_NOT_FOUND","errors":[{"message":"EMAIL_NOT_FOUND","domain":"global","reason":"invalid"}]}}

I made a variable to match the schema, and it all goes nicely into little object:
image

If I try to call pageVars.signInError.message I come up with nothing. I cannot seem to use it in any other function or formula to show what the message is.

I would like to be able to call the pageVars.signInError.message to get “MISSING_EMAIL” or whatever the error is to evaluate it in some formula e.g. If pageVars.signInError.message is equal to “INVALID_PASSWORD” print “Wrong password” and do X flow.

Well, easy enough

outputs["signInRequest"].resBodyParsed.error.message

gets me just what I needed.

2 Likes

Hey!, thanks for sharing this solution, was helpful for me, really apprecciate :slight_smile:

1 Like