Skip to content

Commit

Permalink
api key
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Khayat committed Oct 13, 2018
1 parent 332914a commit b01ffe3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
6 changes: 3 additions & 3 deletions app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"outDir": "dist",
"baseUrl": ".",
"experimentalDecorators": true,
"allowJs": true,
"lib": [
"es5",
"es6",
Expand Down
5 changes: 1 addition & 4 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
"prefer-const": true,
"jsdoc-format": true,
"no-console": [false, "log"],
"no-any": false,
"jsRules":{
"no-empty": true
}
"no-any": false
}
}

0 comments on commit b01ffe3

Please sign in to comment.