feat: add remember-me mechanism to enhance user login experience
What type of PR is this?
/kind feature /area core /milestone 2.16.x
What this PR does / why we need it:
为登录增加记住我机制以优化登陆体验
how to test it?
- 勾选记住密码选项后登录
- 退出浏览器后打开 console 期望依然可以访问而不需要登录
- 测试修改密码功能,期望修改密码后所有会话需要重新登录包括当前设备和其他设备
Which issue(s) this PR fixes:
Fixes #2362
Does this PR introduce a user-facing change?
为登录增加记住我机制以优化登录体验
@ruibaby 帮忙适配一下 Console 登陆页面,添加记住我选项,此时需要为登陆 API 传递查询参数 remember-me=true
Codecov Report
Attention: Patch coverage is 27.16535% with 185 lines in your changes are missing coverage. Please review.
Project coverage is 56.46%. Comparing base (
5fdf6c0) to head (d4573bb). Report is 199 commits behind head on main.
:exclamation: Current head d4573bb differs from pull request most recent head 66c03ee
Please upload reports for the commit 66c03ee to get more accurate results.
Additional details and impacted files
@@ Coverage Diff @@
## main #5929 +/- ##
============================================
- Coverage 56.91% 56.46% -0.45%
- Complexity 3319 3512 +193
============================================
Files 587 617 +30
Lines 18968 20745 +1777
Branches 1401 1440 +39
============================================
+ Hits 10795 11713 +918
- Misses 7594 8449 +855
- Partials 579 583 +4
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
/ping @JohnNiang
/hold 经过探讨发现通过 session 的 cookie 来实现 remember me 很容易被覆盖比如 totp,因此此 PR 将实现 Token Based 的方式来使用一个新的 cookie 值避免被影响
/unhold
另外,建议本地 squash 一下 commits。
Done
Quality Gate passed
Issues
4 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.2% Duplication on New Code
Codecov Report
Attention: Patch coverage is 27.38095% with 183 lines in your changes are missing coverage. Please review.
Project coverage is 56.38%. Comparing base (
5fdf6c0) to head (66c03ee). Report is 201 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #5929 +/- ##
============================================
- Coverage 56.91% 56.38% -0.53%
- Complexity 3319 3501 +182
============================================
Files 587 615 +28
Lines 18968 20698 +1730
Branches 1401 1439 +38
============================================
+ Hits 10795 11671 +876
- Misses 7594 8446 +852
- Partials 579 581 +2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: JohnNiang
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [JohnNiang]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment