Secure token request helper swallows API errors and hides auth/cookie failures
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 65/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- authentication
Direzione di ricerca
Inizia da packages/auth/src/utils/tokenRequestHandler.ts:25-26 e ispeziona il blocco catch e i suoi chiamanti. Riproduci una richiesta /auth-token non riuscita in modalità di autenticazione sicura, quindi verifica che gli errori della richiesta vengano rifiutati invece di risolversi in undefined e che i chiamanti possano distinguere un errore dall’assenza di un token.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
tokenRequestHandler logs errors but does not rethrow them, causing failed secure token requests to silently resolve as undefined.
Affected Code
packages/auth/src/utils/tokenRequestHandler.ts:25packages/auth/src/utils/tokenRequestHandler.ts:26
Problem
In the catch block, errors are only logged:
- no rethrow
- no explicit failure result
This makes callers treat real request failures as missing token/null-like outcomes.
Impact
- Silent auth/cookie failures
- Hard-to-debug secure login behavior
- Error handling paths are bypassed because promise rejection never occurs
Reproduction
- Use secure auth mode.
- Cause
/auth-tokenrequest to fail (network failure / non-2xx). - Observe
tokenRequestHandlerreturnsundefinedinstead of rejecting. - Caller falls back as if no token was present.
Expected
Request failure should reject so callers can handle true error conditions.
Actual
Failure is swallowed and converted into implicit undefined.
Proposed Fix
Rethrow after logging in tokenRequestHandler (or return a typed error result), so callers can reliably distinguish failure from missing token cases.
- Lingua principale
- JavaScript
- Stelle
- 165
- Fork
- 381
- Merge medio
- 1g 2h
- PR unite (30g)
- 1
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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 RocketChat/EmbeddedChat
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
RocketChat/EmbeddedChat#1360 · 1 commento ·
-
Permissions change-detection in useFetchChatData is dead — applyPermissions re-runs on every call Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
RocketChat/EmbeddedChat#1317 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
RocketChat/EmbeddedChat#1315 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
RocketChat/EmbeddedChat#1313 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
RocketChat/EmbeddedChat#1294 ·
Tutte le issue di RocketChat/EmbeddedChat
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Daemon passes --experimental-wasm-jspi unconditionally on Node >= 24; Node 26 rejects the flag Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Automattic/studio#4908 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
sugarlabs/musicblocks#8847 ·