Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

功能请求:支持设置 OAuth 登录(如 GitHub)的有效期延长 #122

Open
ypq123456789 opened this issue Mar 7, 2025 · 0 comments

Comments

@ypq123456789
Copy link

功能请求:支持设置 OAuth 登录(如 GitHub)的有效期延长

问题描述

目前哪吒探针使用 GitHub 等 OAuth 登录方式时,登录会话的有效期较短,导致需要频繁重新登录,影响用户体验。在管理多台服务器的场景下,频繁的登录操作会带来不便。

期望功能

希望能够在配置文件中添加选项,允许管理员自定义 OAuth 登录(特别是 GitHub 登录)后的会话有效期,例如可以设置为 30 天、60 天或更长时间。

建议实现方式

可以在配置文件中添加类似以下的配置项:

oauth2:
  sessionDuration: 2592000  # 会话有效期,单位:秒(此处设置为 30 天)
  refreshToken: true        # 是否启用自动刷新令牌
  GitHub:
    # 现有配置保持不变
    clientid: "xxx"
    clientsecret: "xxx"
    # ...

或者单独为每个 OAuth 提供商配置会话时长:

oauth2:
  GitHub:
    # 现有配置
    sessionDuration: 2592000  # 此提供商的特定会话时长

技术考虑

可能需要调整后端的 JWT 令牌过期时间或会话管理机制
需要考虑安全性与便利性的平衡
可以参考其他开源项目的会话管理实现方式

其他信息

此功能将显著提升长期使用哪吒探针管理多台服务器的用户体验,减少重复登录的操作,特别是对于使用手机等移动设备访问面板的用户更为便利。

感谢开发团队对此功能请求的考虑!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant