The sign-in redirect URL is built by hand in five places
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- next.js, typescript
- Ambito
- authentication, backend-api-design
Direzione di ricerca
Read src/auth/callback-url.ts and the five call sites named in the issue, then check the three listed e2e specs and the existing test setup. Add and test the shared URL helper, replace the five literals, and run the listed lint, format, typecheck, knip, and test commands. Done means no hand-built /login?callbackUrl= remains in src and the e2e specs pass unchanged.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
Five places write the same template literal, /login?callbackUrl=${encodeURIComponent(x)}, with no shared helper:
requireOrganizerSessioninsrc/auth/session.ts- the consent page
src/app/oauth/consent/[uid]/page.tsx, twice: the signed-out redirect andswitchAccount src/app/oauth/consent/[uid]/decision/route.tsswitchAccountinsrc/components/signup/SignupLoadError.tsx
The two "Sign in as someone else" actions also each explain the same reason in their own words: plain /login would bounce a signed-in organizer straight back to /app, so they sign out first. src/auth/callback-url.ts already owns the callback rules and is the natural home for the URL. Nobody using OpenSignup would notice a fix.
Fix, in outline
- Add
loginUrl(callbackUrl: string)tosrc/auth/callback-url.ts. It builds the URL and nothing else: don't callsafeCallbackUrlinside it. The callers already do that where it's needed, and the consent paths are pre-validated. - Optionally, add
switchOrganizer(callbackUrl)insrc/auth/sign-out.ts, which callssignOutOrganizer(loginUrl(callbackUrl))and carries the shared "why sign out first" comment once. EachswitchAccountkeeps only its site-specific note. - Replace the five literals.
redirect()andsignOutOrganizer()calls stay where they are.
Watch for
- This touches
src/authand the OAuth consent pages, so the PR waits for the owner even though output is byte-identical. A scratch test showed the helper matches all five current expressions for every input tried: paths with queries, unicode, already-encoded input, and 128-character consent uids. - The e2e specs that assert the URL (
tests/e2e/organizer.spec.ts,login-code.spec.ts,oauth-consent.spec.ts) must pass unchanged. - The net line count is about zero; the gain is one owner for the URL shape.
Done when
- No hand-built
/login?callbackUrl=string is left insrc. - A unit test pins
loginUrl. pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm testpass.
Found by the pipeline's refactor scout in sign-in and OAuth (src/auth, src/app/oauth), at c1e1cad. Checked by an independent verify agent, which grepped every callbackUrl= and /login in src and tests and ran a scratch vitest comparing a shared helper with each copy. https://claude.ai/code/session_016YZ9ST4ox4Tmm6UZcobKgf
Held back by the scout's cap. Add pipeline:ready to queue it.
- Lingua principale
- TypeScript
- Stelle
- 19
- Fork
- 4
- Merge medio
- 19h 15m
- PR unite (30g)
- 205
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun 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 richshaw/OpenSignup
-
The sign-up dialog's "See alternatives" link looks out of place, and is too small to tap on a phoneApertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
richshaw/OpenSignup#810 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
richshaw/OpenSignup#794 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement pipeline:proposed pipeline:ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
richshaw/OpenSignup#654 ·
I maintainer di solito rispondono entro 1 giorno
-
The sign-up dialog decides "See alternatives" with its own copy of the rule behind "Pick another slot."Forse già presa @dafeiyupola l’ha presa 1 giorno fa. Apertaenhancement good first issue pipeline:ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
richshaw/OpenSignup#803 ·
I maintainer di solito rispondono entro 1 giorno
-
A failed database query logs its parameters, so OAuth tokens and participant details can end up in the logsForse già presa @richshaw l’ha presa 2 giorni fa. Apertabug pipeline:building
richshaw/OpenSignup#800 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di richshaw/OpenSignup
Issue simili
-
desktop v3 windows
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
esengine/DeepSeek-Reasonix#15016 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
FR: Support CJK brackets, symbols and full-width markers in footnoteHeuristics (EBPAJ support)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
readest/readest#7413 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue priority: medium size: XS
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
content triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eliasstravik/herdr-projects#788 ·