From b01ffe3e2e8b37de88598cf4bbb27cd2b63d1b4c Mon Sep 17 00:00:00 2001 From: Muhammad Khayat Date: Sat, 13 Oct 2018 19:38:34 +0700 Subject: [PATCH] api key --- app/index.ts | 6 +++--- tsconfig.json | 1 - tslint.json | 5 +---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/index.ts b/app/index.ts index c52ad2b..7981e8e 100644 --- a/app/index.ts +++ b/app/index.ts @@ -30,8 +30,8 @@ const server = new ApolloServer({ context: ({req}:any={}) => { //console.log(req) if(typeof req !== 'undefined' && typeof req.headers !== 'undefined'){ - if(typeof req.headers.datakit_api_key !== 'undefined'){ - if(validateApiKey(req.headers.datakit_api_key)){ + if(req.headers.x_datakit_api_key !== 'undefined'){ + if(validateApiKey(req.headers.x_datakit_api_key)){ //console.log('authorized') return { authorized: true @@ -45,7 +45,7 @@ const server = new ApolloServer({ onConnect: (connectionParams:any, webSocket, context) => { //console.log(webSocket) if (connectionParams.datakit_api_key) { - if(validateApiKey(connectionParams.datakit_api_key)){ + if(validateApiKey(connectionParams.x_datakit_api_key)){ return { authorized: true } diff --git a/tsconfig.json b/tsconfig.json index b9d083b..2cc5119 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,6 @@ "outDir": "dist", "baseUrl": ".", "experimentalDecorators": true, - "allowJs": true, "lib": [ "es5", "es6", diff --git a/tslint.json b/tslint.json index 75fba1e..ed874c6 100644 --- a/tslint.json +++ b/tslint.json @@ -16,9 +16,6 @@ "prefer-const": true, "jsdoc-format": true, "no-console": [false, "log"], - "no-any": false, - "jsRules":{ - "no-empty": true - } + "no-any": false } } \ No newline at end of file