Code Monkey home page Code Monkey logo

Comments (4)

Issues-translate-bot avatar Issues-translate-bot commented on May 27, 2024

Bot detected the issue body's language is not English, translate it automatically.


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!

from chatgpt-next-web.

RoversX avatar RoversX commented on May 27, 2024

使用中发现在vercel上设置了GOOGLE_API_KEY无效

看源代码后发现,在api/google/route.ts文件第52行直接获取头部Authorization的值,有值直接使用无值才会使用服务端配置

但是当配置访问密码CODE后,头部Authorization是一直都有nk-xxxxxxx这样格式的值导致判断错误

希望能修复这个问题,感谢!

Same problem

from chatgpt-next-web.

Issues-translate-bot avatar Issues-translate-bot commented on May 27, 2024

Bot detected the issue body's language is not English, translate it automatically.


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 obtains 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.

But when the access password CODE is configured, the Authorization header always has a value in the format of nk-xxxxxxx, which leads to an error in judgment.

Hope this can be fixed, thanks!

Same problem

from chatgpt-next-web.

fred-bf avatar fred-bf commented on May 27, 2024

Hi, the authorization key were injected through(a bit hacky)

req.headers.set("Authorization", `Bearer ${systemApiKey}`);

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.

from chatgpt-next-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.