Don't emit an antiforgery token on every page for signed-in users

Aperta
#1,607 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
backend

Direzione di ricerca

Start with _Layout.cshtml and the ReadingContext view component, then trace where scripts need an antiforgery token and how SignInManager.IsSignedIn is checked. Make token retrieval lazy for pages that need it and remove the duplicate sign-in checks. Verify pages without scripts no longer emit antiforgery cookies or no-store/Pragma headers, and that token-dependent scripts still work.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

_Layout.cshtml calls Antiforgery.GetAndStoreTokens on every page for signed-in users, adding Set-Cookie and no-store/Pragma headers everywhere, and would leak a shared token if [OutputCache] is ever applied. Fetch the token lazily only where a script needs it. The layout and ReadingContext view component also each re-check SignInManager.IsSignedIn.

Found during review of #1267; intentionally kept out of that PR.

Lingua principale
HTML
Stelle
8
Fork
8
Merge medio
3h 24m
PR unite (30g)
91

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di IntelliTect/EssentialCSharp.Web

Tutte le issue di IntelliTect/EssentialCSharp.Web

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.