mirror of
https://github.com/wassname/talk.git
synced 2026-07-17 11:33:39 +08:00
Adding Bearer token to the Graph Client
This commit is contained in:
@@ -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
@@ -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"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user