Closed franocisgar closed 1 year ago
@Yidadaa 这里能不能换个请求头,Authorization
和 basic_auth 的请求头冲突
https://github.com/Yidadaa/ChatGPT-Next-Web/blob/bc523d302b7c05050a71cf0460588049aab9d2f9/app/api/auth.ts#L30
我看原来貌似用的是 token
来获取用户输入的api key
应该是这个 commit 引入的: https://github.com/Yidadaa/ChatGPT-Next-Web/commit/48ebd74859042aaa3d8cdbb74a61bd7391400b89
@Yidadaa 这里能不能换个请求头,
Authorization
和 basic_auth 的请求头冲突我看原来貌似用的是
token
来获取用户输入的api key 应该是这个 commit 引入的: 48ebd74
@Yidadaa 我有同样的问题,我使用华为云FunctionGraph来部署了ChatGPT-Next-Web,通过华为云的APIG网关来访问页面,当不适用密码是访问正常,可以正常chat,但是当我设置了Code环境变量,并在设置页面输入了密码后,所有HTTPS请求都会被APIG网关拦截,报错401认证错误,原因就是华为云的APIG网关会使用Authorization字段进行鉴权,但是ChatGPT-Next-Web的前端会把密码、API key得信息填写到Authorization字段导致华为云APIG网关鉴权失败,所以建议换一个请求头域段来承载这两个信息,下面是我测试过程的截图,图一是不使用Code密码的访问情况,
图二是使用CODE密码的访问情况
Bot detected the issue body's language is not English, translate it automatically.
@Yidadaa Can you change the request header here?
Authorization
conflicts with the request header of basic_authIt seems that
token
is used to obtain the api key entered by the user. It should be introduced by this commit: 48ebd74
@Yidadaa I have the same problem. I used Huawei Cloud FunctionGraph to deploy ChatGPT-Next-Web and accessed the page through Huawei Cloud's APIG gateway. When the password is not applicable, the access is normal and chat can be normal, but when I set the Code After setting the environment variable and entering the password on the settings page, all HTTPS requests will be intercepted by the APIG gateway and a 401 authentication error will be reported. The reason is that Huawei Cloud's APIG gateway will use the Authorization field for authentication, but the front end of ChatGPT-Next-Web will Filling in the password and API key information into the Authorization field caused Huawei Cloud APIG gateway authentication to fail. Therefore, it is recommended to change a request header field to carry these two information. The following is a screenshot of my test process. Figure 1 does not use the Code password. The access situation, Figure 2 shows the access situation using CODE password
用docker部署后,nginx反代同时使用http auth后,会不断要求重新验证,用user:pass@domain 来登录的话就会输入授权密码后就直接
之前还是可以用http auth前置反代的。