Allow configuring login cookie with an expiry duration
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- authentication
Direzione di ricerca
Inizia in src/node/http.ts intorno alla riga 328, quindi segui come vengono definiti e letti gli argomenti di configurazione. Aggiungi un’impostazione opzionale di scadenza per il cookie di accesso, mantenendo il comportamento del cookie di sessione quando è assente o pari a zero. Verifica che la durata configurata mantenga il cookie di accesso dopo la chiusura del browser.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What is your suggestion?
Allow configuring an (optional) expiry age for the login cookie so that it persists beyond a browser session. This is handy for not re-entering the password every time.
Possible change:
https://github.com/coder/code-server/blob/main/src/node/http.ts#L328
...
return {
domain: getCookieDomain(url.host, req.args["proxy-domain"]),
path: normalize(url.pathname) || "/",
sameSite: "lax",
// Load, if provided, max age for login cookie. 0 means it becomes a Session cookie (according to Express docs)
maxAge: getConfigCookieMaxAgeAsMilliseconds() || 0,
}
Why do you want this feature?
I want to maintain my login status even after closing the browser (as the Cookie is currently session-only). Say keep the login cookie for a week or a month. Adding a max-age changes the cookie from Session to persistent for the given duration using Express' maxAge parameter (docs).
Are there any workarounds to get this functionality today?
No, none directly. User can manually edit the cookie in Devtools
Are you interested in submitting a PR for this?
I'm not that familiar with how to make new configuration argument and also how the config args are read (there's some middleware for args IIRC, but not sure how to use that). But I can give it a go, with some help.
The above given change should be roughly all that's needed, sans the config reading.
- Lingua principale
- TypeScript
- Stelle
- 79.4k
- Fork
- 6.9k
- Merge medio
- 2g 13h
- PR unite (30g)
- 39
Guida per i contributori
Apri 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 coder/code-server
-
Bump proxy-addr to 2.0.8 Apertasecurity
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
coder/code-server#8013 · 3 commenti ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
coder/code-server#7976 · 2 commenti ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
coder/code-server#7962 · 3 commenti ·
-
bug needs-investigation
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
coder/code-server#7955 · 1 commento ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
coder/code-server#7948 · 1 commento · 2 reazioni ·
Tutte le issue di coder/code-server
Issue simili
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
Ecosystem: ClawMetry — the Qwen Code reader is now free and open source (follow-up to #9294 / #9338) Apertacategory/integration priority/P3 scope/documentation status/ready-for-human type/feature-request
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
-
area:auth FE mvp P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
klasolsson81/jobbliggaren#1788 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
get-convex/migrations#69 ·
-
accessibility angular bug good first issue typescript ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
apache/fineract-backoffice-ui#584 · 1 commento ·