Skip to content

Commit

Permalink
Fix token precedence
Browse files Browse the repository at this point in the history
  • Loading branch information
ytkimirti committed Jan 22, 2024
1 parent 12ead65 commit 8f57681
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ export class Index extends core.Index {
return;
}
const token =
configOrRequester?.token ??
process.env.NEXT_PUBLIC_UPSTASH_VECTOR_REST_TOKEN ??
process.env.UPSTASH_VECTOR_REST_TOKEN ??
configOrRequester?.token;
process.env.UPSTASH_VECTOR_REST_TOKEN;
const url =
configOrRequester?.url ??
process.env.NEXT_PUBLIC_UPSTASH_VECTOR_REST_URL ??
process.env.UPSTASH_VECTOR_REST_URL ??
configOrRequester?.url;
process.env.UPSTASH_VECTOR_REST_URL;

if (!token) {
throw new Error("UPSTASH_VECTOR_REST_TOKEN is missing!");
Expand Down

0 comments on commit 8f57681

Please sign in to comment.