You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using v9 and when following the documentation for blocker functions here to send a custom error message to the Firebase Auth SDK, error messages are malformed and do not contain the data that the docs claim they should.
Here is the blocker function we are running:
constgcipCloudFunctions=require('gcip-cloud-functions');constauthClient=newgcipCloudFunctions.Auth();exports.beforeCreate=authClient.functions().beforeCreateHandler((user,context)=>{thrownewgcipCloudFunctions.https.HttpsError('invalid-argument',`this is a custom error message`);})
This is the network error that is received in the browser after the blocker function errors:
{
"error": {
"code": 400,
"message": "BLOCKING_FUNCTION_ERROR_RESPONSE : HTTP Cloud Function returned an error: {\"error\":{\"code\":400,\"message\":\"this is a custom error message\",\"status\":\"INVALID_ARGUMENT\"}}",
"errors": [
{
"message": "BLOCKING_FUNCTION_ERROR_RESPONSE : HTTP Cloud Function returned an error: {\"error\":{\"code\":400,\"message\":\"this is a custom error message\",\"status\":\"INVALID_ARGUMENT\"}}",
"domain": "global",
"reason": "invalid"
}
]
}
}
This is the error (serialized) that the client SDK receives after the failed attempt to create a user:
Hey @Feiyang1 , @sam-gc could anyone of you cc me as well once the internal bug is filed? I am also working on blocking function, and receiving a similar issue for blocking function in link.
I might be able to help when I have time, thanks!
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
When using v9 and when following the documentation for blocker functions here to send a custom error message to the Firebase Auth SDK, error messages are malformed and do not contain the data that the docs claim they should.
Here is the blocker function we are running:
This is the network error that is received in the browser after the blocker function errors:
This is the error (serialized) that the client SDK receives after the failed attempt to create a user:
As you can see, the SDK error does not contain the same information as is visible in the network tab.
cc: @derekperkins
The text was updated successfully, but these errors were encountered: