Registering without a password returns a 500 instead of telling you what is missing
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- express, typescript
- Área
- api, authentication, backend
Línea de trabajo
Empieza en apps/http-server/src/controllers/authController.ts y compara la comprobación de campos obligatorios del controlador de registro con la del controlador de inicio de sesión. Añade cobertura para los campos ausentes y vacíos, y luego verifica que el ejemplo de curl responda con 400 e indique el campo que falta, y que el registro válido siga funcionando. El issue también sugiere revisar quizController e inviteController para detectar carencias similares en la validación del cuerpo de la solicitud.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The register handler reads the body and goes straight to work:
// apps/http-server/src/controllers/authController.ts
export const userRegisterController = async (req: Request, res: Response) => {
try {
const { name, email, password } = req.body;
const isUserExisted = await prisma.user.findUnique({ where: { email } })
if (isUserExisted) return errorResponse(res, 400, "Email is already existed..")
const hashedPassword = await bcrypt.hash(password, 10); // throws when undefined
There is no presence check, so a missing field reaches bcrypt.hash(undefined, 10), which throws into the catch and returns a generic 500.
Confirmed against the live API:
POST /api/v1/auth/register {"name":"t","email":"..."} # no password
→ 500 {"success":false,"error":"Internal Server Error..."}
The sibling login handler in the same file already does it right:
if (!email || !password) return errorResponse(res, 400, "All fields are required...");
Why it matters
A 500 says "the server is broken". A 400 says "you forgot the password". Anyone integrating with the API, or debugging a form that failed to send a field, is sent looking in the wrong place entirely — and 500s are what you page on, so this also adds noise to any error monitoring.
What a fix looks like
The smallest version is the same guard login uses. Better, since zod ^4.3.6 is already a dependency: validate the shape properly and say which field is wrong, not just that something is.
Worth checking the other controllers for the same gap while you are there — quizController and inviteController have endpoints that read req.body directly too. If you find more, mention them in the PR; fixing them all in one change is fine as long as the description lists them.
Definition of done
curl -X POST .../api/v1/auth/register -H "Content-Type: application/json" -d "{\"email\":\"[email protected]\"}"
# → 400, naming the missing field
- No request with a missing or empty field can reach
bcrypt.hash - A valid registration still works exactly as before
Good first issue: a few lines, with a working example of the right pattern directly above it in the same file.
- Lenguaje dominante
- TypeScript
- Estrellas
- 21
- Forks
- 7
- Merge medio
- 3 h 39 min
- PR fusionados (30 d)
- 16
Preparar el entorno
- Incluye un Dockerfile o un 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 TheCodeHeist-Coder/Rexial
-
documentation good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
TheCodeHeist-Coder/Rexial#195 ·
Los mantenedores suelen responder en 1 día
-
Backend first issue bug help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
TheCodeHeist-Coder/Rexial#193 ·
Los mantenedores suelen responder en 1 día
-
Backend first issue bug good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
TheCodeHeist-Coder/Rexial#192 ·
Los mantenedores suelen responder en 1 día
-
good first issue help wanted UI & UX
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
TheCodeHeist-Coder/Rexial#190 ·
Los mantenedores suelen responder en 1 día
-
Backend first issue good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
TheCodeHeist-Coder/Rexial#188 ·
Los mantenedores suelen responder en 1 día
Todos los issues de TheCodeHeist-Coder/Rexial
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
braintrustdata/braintrust-sdk-javascript#2659 ·
Los mantenedores suelen responder en 1 día
-
body-parser 2.3.0 in the published ai-dial-chat-bff image is vulnerable (CVE-2026-111181, HIGH)Posiblemente ocupada @illya-havsiyevych la tomó hoy. Abiertobug
Dificultad 1/5 1-3 horas Aptitud para principiantes 87/100
epam/ai-dial-chat#9566 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
はさみアイコンを修正するAbiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
-
resource.reload() while params is in error switches the resource to 'idle' instead of retryingAbiertoarea: core
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día