-
Notifications
You must be signed in to change notification settings - Fork 60.2k
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
[Feature] 部署在vercel上GOOGLE_API_KEY失效的问题,希望修改获取KEY的代码部分 #3931
Comments
Title: [Feature] The problem of GOOGLE_API_KEY failure when deployed on vercel. I hope to modify the code part for obtaining KEY. During use, it was found that the GOOGLE_API_KEY set on vercel was invalid. After looking at the source code, I found that in line 52 of the [api/google/route.ts file](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/blob/981a3629b6eeb9f41090c2a7cd4fd568f6981a55/app/api/google/%5B. ..path%5D/route.ts#L52) Directly obtain the value of the header Authorization. If there is a value, use it directly. If there is no value, the server configuration will be used. However, after configuring the access password CODE, the Authorization header always has a value in the format of nk-xxxxxxx, which leads to incorrect judgment. Hope this can be fixed, thanks! |
Same problem |
Same problem |
Hi, the authorization key were injected through(a bit hacky) https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/blob/981a3629b6eeb9f41090c2a7cd4fd568f6981a55/app/api/auth.ts#L68 I tried to reproduce the issue, but it works fine on my end. if you still encounter please provide a reproducible environment or provide env keys you've set. |
使用中发现在vercel上设置了GOOGLE_API_KEY无效
看源代码后发现,在api/google/route.ts文件第52行直接获取头部Authorization的值,有值直接使用无值才会使用服务端配置
但是当配置访问密码CODE后,头部Authorization是一直都有nk-xxxxxxx这样格式的值导致判断错误
希望能修复这个问题,感谢!
The text was updated successfully, but these errors were encountered: