Skip to content

Firebase Auth: Exception when signup has been blocked by cloud function is too generic #5429

Open
@janseeger

Description

@janseeger

[READ] Step 1: Are you in the right place?

I think so.

[REQUIRED] Step 2: Describe your environment

  • Firebase Component: Auth
  • Component version: 21.3

[REQUIRED] Step 3: Describe the problem

When the signup is blocked by the cloud function it returns a rather generic FirebaseException with the message:

An internal error has occurred. [ BLOCKING_FUNCTION_ERROR_RESPONSE:HTTP Cloud Function returned an error: {"error":{"message":"Signup with provider [google.com](http://google.com/) not allowed","status":"PERMISSION_DENIED"}} ]

This should be either a specific Exception (like FirebaseAuthBlockingFunctionErrorException) or a FirebaseAuthException with a proper code set.

Login logic shouldn't have to parse the returned exception message for magic strings or have to parse JSON to be able to react to errors.

Steps to reproduce:

  1. Set up Firebase Auth with a blocking cloud function
  2. Sign up with a data that matches the blocking criteria

Relevant Code:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions