[Bug]: Logged-in participants are never linked to their account
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 70/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- express, typescript
- Ambito
- api, authentication, backend
Direzione di ricerca
Start with authMiddleware in apps/http-server/src/middlewares/authmiddleware.ts to see how the token is verified, then look at the POST /join route in apps/http-server/src/routes/session.ts and joinQuizController in sessionController.ts, which reads req.userId. Add an optional variant that sets req.userId only when a valid token is present and otherwise calls next(). Done when a signed-in join stores its userId, and anonymous and expired-token joins still succeed.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened?
joinQuizController in apps/http-server/src/controllers/sessionController.ts
stores the participant's user id:
const participant = await tx.participant.create({
data: {
username,
sessionId: session.id,
userId: req.userId || null
}
});
But the route has no authMiddleware:
apps/http-server/src/routes/session.ts:
router.post("/join", joinQuizController)
req.userId is only ever set by authMiddleware, so it is always
undefined here, and every participant row is written with userId: null —
including participants who are signed in.
Why it matters. planning.md promises that a registered user can see the
quizzes they participated in. getAllQuizesController cannot deliver that,
because nothing connects a Participant row to a User. The feature is
silently broken.
The tricky part. Joining must stay open to anonymous participants — that is
a core feature, no signup required to play. So this cannot simply have
authMiddleware bolted on, which would reject anonymous joins with a 401.
What is needed is optional authentication: attach req.userId when a valid
token is present, and continue without it otherwise.
Steps to reproduce
Suggested fix. Add an optionalAuth middleware next to the existing one in
apps/http-server/src/middlewares/authmiddleware.ts:
- No
Authorizationheader → callnext()with noreq.userId - Valid token → set
req.userId, callnext() - Malformed or expired token → also just
next()withoutreq.userId, so a
stale token in someone's browser does not block them from joining a quiz
Then apply it to POST /join.
Definition of done:
- A signed-in user who joins gets a
Participantrow with theiruserId - An anonymous user can still join with no token at all
- An expired token does not prevent joining
- Participation history works for registered users
Which part of Rexial?
http-server (Express REST API)
How are you running Rexial?
Docker Compose (docker-compose up)
Logs or error output
Environment
No response
Before submitting
- I searched existing issues and this has not been reported
- I am not including any secrets, API keys or passwords in this report
- Lingua principale
- TypeScript
- Stelle
- 21
- Fork
- 7
- Merge medio
- 4h 13m
- PR unite (30g)
- 20
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TheCodeHeist-Coder/Rexial
-
Redis is required to run the app but is in neither setup guideForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertadocumentation good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
TheCodeHeist-Coder/Rexial#195 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
One PDF upload freezes the whole AI service, including its health checkForse già presa @Anshuu2004 l’ha presa 1 giorno fa. ApertaBackend first issue bug help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
TheCodeHeist-Coder/Rexial#193 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
The join endpoint returns an error shape the frontend cannot readForse già presa @Anshuu2004 l’ha presa 1 giorno fa. ApertaBackend first issue bug good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
TheCodeHeist-Coder/Rexial#192 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Registering without a password returns a 500 instead of telling you what is missingForse già presa @Anshuu2004 l’ha presa 1 giorno fa. ApertaBackend first issue bug good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
TheCodeHeist-Coder/Rexial#191 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
CI does not run the frontend testsForse già presa @nayan45633 l’ha presa 1 giorno fa. ApertaBackend first issue good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
TheCodeHeist-Coder/Rexial#188 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di TheCodeHeist-Coder/Rexial
Issue simili
-
[Bug]: Device screenshot fails with 500 on iPhone Duo (Xcode 27.2): serve-sim calls simctl without --displayForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
pingdotgg/t3code#24900 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
inu-appcenter/UNIDorm-web#411 ·
I maintainer di solito rispondono entro 1 giorno
-
🐛 bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
ranxianglei/billion-context#4720 ·
I maintainer di solito rispondono entro 1 giorno
-
area:arcade game p3-medium ready-for-agent type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
fderuiter/deruiter.dev#2840 ·
I maintainer di solito rispondono entro 1 giorno