mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
Ádding another extractor
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user