Created by: oblivisheee
This pull request includes significant changes to the assistant/src/interfaces.rs file to improve token handling and authentication, as well as updates to the conf/nginx.conf file to handle CORS preflight requests. The most important changes are summarized below:
Improvements to Token Handling and Authentication:
-
assistant/src/interfaces.rs: Updated thechat_sessionfunction to use query parameters for tokens instead of headers. This includes modifications to extractauth_tokenandsession_tokenfrom the query parameters. [1] [2] -
assistant/src/interfaces.rs: Introduced a new helper functiontoken_string_from_headerto convert token headers to strings, and updated various functions (get_chat,get_chats,create_chat,delete_chat) to use this helper function. [1] [2] [3] [4] -
assistant/src/interfaces.rs: Refactoredauth_token_with_natsto directly accept a string token instead of a header, improving the clarity and efficiency of token verification. [1] [2] -
assistant/src/interfaces.rs: Modifiedprocess_session_tokento accept an optional string token instead of a header, streamlining session token processing.