Skip to content

createSessionCookie does not pick up USER_DISABLED errors #1503

@rhodgkins

Description

@rhodgkins

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

  • For issues related to the code in this repository file a Github issue.
  • If the issue pertains to Cloud Firestore, read the instructions in the "Firestore issue"
    template.
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Operating System version: macOS
  • Firebase SDK version: 10.0.0
  • Firebase Product: auth
  • Node.js version: 16
  • NPM version: N/A

[REQUIRED] Step 3: Describe the problem

The following generic error is returned:

{
    code: 'auth/internal-error', 
    message: 'An internal error has occurred. Raw server response: "{"error":{"code":400,"message":"USER_DISABLED","errors":[{"message":"USER_DISABLED","reason":"invalid","domain":"global"}]}}"'
}

Where as there is a auth/user-disabled error code defined so should use that instead:

public static USER_DISABLED = {
code: 'user-disabled',
message: 'The user record is disabled.',
}

So I'd expect a similar error to using .verfiyIdToken for a disabled user:

{
   code: 'auth/user-disabled',
   message: 'The user record is disabled.'
}

Steps to reproduce:

  1. Create a user
  2. Sign in to a client SDK as the user and .getIdToken
  3. Disable the user
  4. In Admin SDK try .createSessionCookie(idToken, { expiresIn: 300000 })

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions