Adding Bearer token to the Graph Client

This commit is contained in:
Belen Curcio
2017-05-15 11:41:36 -03:00
parent 8754ade5a4
commit 76b96a66a2
3 changed files with 405 additions and 394 deletions
+5 -1
View File
@@ -1,11 +1,15 @@
import {createNetworkInterface} from 'apollo-client';
import * as Storage from '../helpers/storage';
export default function getNetworkInterface(apiUrl = '/api/v1/graph/ql', headers = {}) {
return new createNetworkInterface({
uri: apiUrl,
opts: {
credentials: 'same-origin',
headers,
headers: {
Authorization: `Bearer ${Storage.getItem('token')}`,
...headers
},
},
});
}
+2 -3
View File
@@ -93,18 +93,17 @@
"nodemailer": "^2.6.4",
"parse-duration": "^0.1.1",
"passport": "^0.3.2",
"passport-jwt": "^2.2.1",
"passport-local": "^1.0.0",
"prop-types": "^15.5.8",
"react-apollo": "^1.1.0",
"react-recaptcha": "^2.2.6",
"recompose": "^0.23.1",
"redis": "^2.7.1",
"uuid": "^3.0.1",
"simplemde": "^1.11.2",
"subscriptions-transport-ws": "^0.5.5-alpha.0",
"resolve": "^1.3.2",
"semver": "^5.3.0",
"simplemde": "^1.11.2",
"subscriptions-transport-ws": "^0.5.5-alpha.0",
"timekeeper": "^1.0.0",
"uuid": "^3.0.1"
},
+398 -390
View File
File diff suppressed because it is too large Load Diff