From 5b2225f4f4c9f7c30a4422bbd017af197137c9e9 Mon Sep 17 00:00:00 2001 From: Denis Carriere Date: Tue, 13 Feb 2024 17:14:49 -0500 Subject: [PATCH] add JWT error --- package.json | 2 +- src/setup.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 923effd..0c47568 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "substreams-sink", - "version": "0.14.0", + "version": "0.14.1", "description": "Substreams Sink", "type": "module", "exports": "./dist/index.js", diff --git a/src/setup.ts b/src/setup.ts index 08a71c1..f243e5b 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -23,7 +23,8 @@ export async function setup(options: RunOptions) { // Substreams endpoint let baseUrl = options.substreamsEndpoint; - const token = options.substreamsApiToken ?? options.substreamsApiKey; + const token = options.substreamsApiKey ?? options.substreamsApiToken; + if ( token.includes(".")) throw new Error("JWT token is not longer supported, please use Substreams API key instead"); // append https if not present if (baseUrl.match(/http/) === null) {