feat: 支持首次登录强制修改密码及自助改密页面 - #393
Open
fatmanverse wants to merge 10 commits into
Open
Conversation
新增用户自助修改密码能力,并支持新建用户首次登录前强制改密。 服务端: - User 模型新增 change_pwd 字段(xorm Sync2 自动建列,存量用户不受影响) - 新增全局开关 force_first_change_pwd 与门户地址 portal_url 配置项 - 后台新建/批量导入用户时按开关打标 - VPN 登录校验通过后拦截未改密用户,拒登并提示前往改密页 自助改密页面(内置于 VPN 服务 :443): - 新增公开路由 GET/POST /pwd,内联 HTML 表单 - 新增 dbdata.UserChangePassword: 校验旧密码(仅 PIN 码)后更新并清除标记 - 复用 lockManager 防爆限流,复用 PasswordVerify 兼容明文/bcrypt - 用户不存在与旧密码错误返回统一提示,防止用户名枚举 - CSRF 双提交校验,html/template 自动转义防 XSS 文档: - server-sample.toml 补充两个配置项说明 - doc/question.md 新增功能与使用说明
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
新增用户自助修改密码能力,并支持新建用户首次登录前强制改密。
服务端:
自助改密页面(内置于 VPN 服务 :443):
文档: