Ádding another extractor

This commit is contained in:
Belen Curcio
2017-05-25 20:04:32 -03:00
parent cbf7cc67f4
commit 8171cb53e1
4 changed files with 25 additions and 66 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import browser from 'detect-browser';
import browser from 'bowser';
const buildOptions = (inputOptions = {}) => {
const defaultOptions = {
@@ -15,7 +15,7 @@ const buildOptions = (inputOptions = {}) => {
...inputOptions
};
if (!browser || browser.name !== 'safari') {
if (!browser || browser.name !== 'Safari') {
let authorization = localStorage.getItem('token');
if (authorization) {
+6 -1
View File
@@ -1,5 +1,6 @@
import {createNetworkInterface} from 'apollo-client';
import * as Storage from '../helpers/storage';
import browser from 'bowser';
//==============================================================================
// NETWORK INTERFACE
@@ -21,7 +22,11 @@ networkInterface.use([{
if (!req.options.headers) {
req.options.headers = {}; // Create the header object if needed.
}
req.options.headers['authorization'] = `Bearer ${Storage.getItem('token')}`;
if (!browser || browser.name !== 'Safari') {
req.options.headers['authorization'] = `Bearer ${Storage.getItem('token')}`;
}
next();
}
}]);