Allow configuring login cookie with an expiry duration
維護者通常 2 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 45/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- typescript
研究方向
從 src/node/http.ts 約第 328 行開始,接著追蹤設定引數的定義與讀取方式。為登入 cookie 新增可選的到期設定;當該設定缺少或為零時,保留工作階段 cookie 的行為。確認設定的持續時間會在瀏覽器關閉後保留登入 cookie。
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- TypeScript
- 星號
- 79.4k
- 分支
- 6.9k
- 平均合併
- 2 天 15 小時
- 30 天內合併 PR
- 38
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
coder/code-server 的其他 Issue
-
難度 1/5 1 小時以內 新手友好度 92/100
coder/code-server#8017 · 2 則留言 ·
維護者通常 2 天內回覆
-
enhancement
難度 5/5 一週以上 新手友好度 35/100
coder/code-server#7976 · 2 則留言 ·
維護者通常 2 天內回覆
-
enhancement
難度 5/5 一週以上 新手友好度 35/100
coder/code-server#7962 · 3 則留言 ·
維護者通常 2 天內回覆
-
bug needs-investigation
難度 4/5 3-5 天 新手友好度 55/100
coder/code-server#7955 · 1 則留言 ·
維護者通常 2 天內回覆
-
enhancement
難度 5/5 一週以上 新手友好度 42/100
coder/code-server#7948 · 1 則留言 · 2 個 reaction ·
維護者通常 2 天內回覆
查看 coder/code-server 的全部 Issue
相似的 Issue
-
module-request
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 90/100
appandflow/stim#1604 · 1 則留言 ·
維護者通常 1 天內回覆
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難度 1/5 1 小時以內 新手友好度 92/100
lingdojo/kana-dojo#31060 · 1 則留言 · 5 個 reaction ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 90/100
paperclipai/paperclip#14173 ·
維護者通常 1 天內回覆
-
needs-triage
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆