fix: 修复自定义认证密码功能异常 (#771)

fix: 修复自定义认证密码功能异常的问题

- 修复前端属性名错误 (openSettings.auth -> openSettings.needAuth)
- 修复 /open_api/settings 接口被自定义认证拦截的问题

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Dream Hunter
2025-11-23 23:31:23 +08:00
committed by GitHub
parent 113f9ad66b
commit 793901d349
3 changed files with 6 additions and 2 deletions

View File

@@ -1,6 +1,10 @@
<!-- markdownlint-disable-file MD004 MD024 MD034 MD036 -->
# CHANGE LOG
## v1.1.1(feature/email)
- fix: 修复自定义认证密码功能异常的问题 (前端属性名错误 & /open_api 接口被拦截)
## v1.1.0(main)
- feat: |Admin| 维护页面增加清理 n 天前空邮件的邮箱地址功能

View File

@@ -41,7 +41,7 @@ const apiFetch = async (path, options = {}) => {
if (response.status === 401 && path.startsWith("/admin")) {
showAdminAuth.value = true;
}
if (response.status === 401 && openSettings.value.auth) {
if (response.status === 401 && openSettings.value.needAuth) {
showAuth.value = true;
}
if (response.status >= 300) {

View File

@@ -52,7 +52,7 @@ app.use('/*', async (c, next) => {
// check header x-custom-auth
const passwords = getPasswords(c);
if (passwords && passwords.length > 0) {
if (!c.req.path.startsWith("/open_api") && passwords && passwords.length > 0) {
const auth = c.req.raw.headers.get("x-custom-auth");
if (!auth || !passwords.includes(auth)) {
return c.text(msgs.CustomAuthPasswordMsg, 401)