Password policy violation is reported as `auth/internal-error` instead of a specific error code
Los mantenedores suelen responder en 7 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 85/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- firebase, node.js, typescript
- Área
- authentication
Línea de trabajo
Comienza en src/auth/error.ts leyendo AUTH_SERVER_TO_CLIENT_CODE, la entrada AuthErrorCode y FirebaseAuthError.fromServerError. Prueba el mapeo con la cadena PASSWORD_DOES_NOT_MEET_REQUIREMENTS proporcionada. Se considera completado cuando createUser, updateUser y el mapeo directo devuelvan auth/password-does-not-meet-requirements, conservando el mensaje sobre los requisitos que faltan.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
[REQUIRED] Step 2: Describe your environment
- Operating System version: macOS 15.7.7 (local), Cloud Functions Node.js 20 runtime (production)
- Firebase SDK version: firebase-admin 13.8.0 (also reproduced on 14.5.0)
- Firebase Product: auth
- Node.js version: 20.19.2
- NPM version: 10.8.2
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
With a password policy in Require (ENFORCE) mode, auth().createUser() or updateUser() with a non-compliant password rejects with auth/internal-error, not a specific error code.
The server returns PASSWORD_DOES_NOT_MEET_REQUIREMENTS, but that code is missing from AUTH_SERVER_TO_CLIENT_CODE in src/auth/error.ts. FirebaseAuthError.fromServerError therefore falls back to INTERNAL_ERROR. Callers can't tell this user-input error from a real internal error without parsing the message. The client SDK already uses auth/password-does-not-meet-requirements for the same case.
- Enable a password policy in Require mode, e.g. minimum length 10.
- Call
createUserwith a password that doesn't meet it.
Actual: code is auth/internal-error, and the server code only appears in the message:
Missing password requirements: [Password must contain at least 10 characters, Password must contain a lower case character, Password must contain an upper case character] Raw server response: "{"error":{"code":400,"message":"PASSWORD_DOES_NOT_MEET_REQUIREMENTS : Missing password requirements: [...]","errors":[...]}}"
Expected: a specific code, e.g. auth/password-does-not-meet-requirements to match the client SDK, keeping the missing-requirements message.
Suggested fix: add PASSWORD_DOES_NOT_MEET_REQUIREMENTS to AUTH_SERVER_TO_CLIENT_CODE, with a matching AuthErrorCode entry, in src/auth/error.ts.
Relevant Code:
const { getAuth, FirebaseAuthError } = require("firebase-admin/auth");
// Against a project with a password policy in Require mode:
try {
await getAuth().createUser({ email: "[email protected]", password: "weakpass" });
} catch (err) {
console.log(err.code); // "auth/internal-error"
}
// Same mapping, without a project:
const err = FirebaseAuthError.fromServerError(
"PASSWORD_DOES_NOT_MEET_REQUIREMENTS : Missing password requirements: [Password must contain at least 10 characters]"
);
console.log(err.code); // "auth/internal-error", expected "auth/password-does-not-meet-requirements"
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.8k
- Forks
- 420
- Merge medio
- 5 d 6 h
- PR fusionados (30 d)
- 11
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de firebase/firebase-admin-node
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
firebase/firebase-admin-node#3234 ·
Los mantenedores suelen responder en 7 días
-
[email protected] stable dependency tree fails npm audit via Storage uuid and Firestore google-gaxPosiblemente ocupada @lahirumaramba la tomó hace 23 días. Abierto
firebase/firebase-admin-node#3221 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 7 días
-
api: messaging
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
firebase/firebase-admin-node#3215 ·
Los mantenedores suelen responder en 7 días
-
api: messaging
Dificultad 5/5 Más de una semana Aptitud para principiantes 28/100
firebase/firebase-admin-node#3214 ·
Los mantenedores suelen responder en 7 días
-
[Firestore] Re-export functions from '@google-cloud/firestore/pipelines'Quizá libre de nuevo @jonathanedey la tomó hace 93 días y no hay ningún pull request abierto. Abiertoapi: firestore type: feature request
firebase/firebase-admin-node#3183 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 7 días
Todos los issues de firebase/firebase-admin-node
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
siyuan-note/siyuan#20040 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
RunestoneInteractive/rs#1574 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
remotion-dev/remotion#11901 ·
Los mantenedores suelen responder en 1 día
-
Poll constructor throws for an uncached channel while resolving a message context-menu interactionAbiertobug need repro packages:discord.js
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
discordjs/discord.js#11645 ·
Los mantenedores suelen responder en 3 días
-
🐞 bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Sitecore/content-sdk#641 ·
Los mantenedores suelen responder en 2 días