khoj-ai / khoj

Your AI second brain. Get answers to your questions, whether they be online or in your own notes. Use online AI models (e.g gpt4) or private, local LLMs (e.g llama3). Self-host locally or use our cloud instance. Access from Obsidian, Emacs, Desktop app, Web or Whatsapp.
https://khoj.dev
GNU Affero General Public License v3.0
12.63k stars 640 forks source link

[bug]@api_chat.get("") do not @requires(["authenticated"]) #890

Closed thinker007 closed 1 month ago

thinker007 commented 1 month ago

Describe the bug

A clear and concise description of what the bug is. Please include what you were expecting to happen vs. what actually happened. image

@api_chat.get("") do not requires(["authenticated"])

why and is this a bug?

debanjum commented 1 month ago

Thanks for point that out! The authenticated decorator got removed when we merged the websocket and the previous iteration of api_chat.get() in https://github.com/khoj-ai/khoj/pull/858. This would have thrown an internal server error as we expect user property to be always set to process chat requests.

Saba just pushed a fix for it in 2d9dd81e768c5e4f3f70e1291a253c6461f40bde, so the error is more legible going forward and for better defense in depth

thinker007 commented 1 month ago

You are welcome! great fix