Cookie usage for Key
This commit is contained in:
parent
88439ec273
commit
ca3805c44e
@ -13,6 +13,7 @@
|
||||
"laravel-echo": "^1.11.0",
|
||||
"prop-types": "^15.7.2",
|
||||
"react": "^17.0.2",
|
||||
"react-cookie": "^4.1.1",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-hook-form": "^7.6.10",
|
||||
"socket.io-client": "^2.0",
|
||||
|
||||
@ -2,6 +2,7 @@ import { ApolloClient, ApolloLink, ApolloProvider, HttpLink, InMemoryCache } fro
|
||||
import { Router } from '@reach/router';
|
||||
import Echo from 'laravel-echo';
|
||||
import React from 'react';
|
||||
import { useCookies } from 'react-cookie';
|
||||
import io from 'socket.io-client';
|
||||
import classNames from './assets/scss/App.scss';
|
||||
import { useSideBar } from './context/SideBar/SideBarContext';
|
||||
@ -20,6 +21,7 @@ import resolveClassName from './util/resolveClassName';
|
||||
|
||||
const App = (): React.ReactElement => {
|
||||
const { state, toggleState } = useSideBar();
|
||||
const [cookies] = useCookies(['graphql-session-id']);
|
||||
|
||||
const classes = {
|
||||
name: 'container',
|
||||
@ -34,7 +36,7 @@ const App = (): React.ReactElement => {
|
||||
client: io,
|
||||
auth: {
|
||||
headers: {
|
||||
'Gql-Session': 'SUPER_SECRET_KEY_HEADER',
|
||||
'Gql-Session': cookies['graphql-session-id'],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@ -1,11 +1,14 @@
|
||||
import React from 'react';
|
||||
import { CookiesProvider } from 'react-cookie';
|
||||
import ReactDOM from 'react-dom';
|
||||
import App from './App';
|
||||
import SideBarProvider from './context/SideBar/SideBarContext';
|
||||
|
||||
ReactDOM.render(
|
||||
<SideBarProvider>
|
||||
<App />
|
||||
</SideBarProvider>,
|
||||
<CookiesProvider>
|
||||
<SideBarProvider>
|
||||
<App />
|
||||
</SideBarProvider>
|
||||
</CookiesProvider>,
|
||||
document.getElementById('root')
|
||||
);
|
||||
|
||||
37
yarn.lock
37
yarn.lock
@ -1736,6 +1736,19 @@
|
||||
resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.1.1.tgz#3348564048e7a2d7398c935d466c0414ebb6a669"
|
||||
integrity sha512-Z6DoceYb/1xSg5+e+ZlPZ9v0N16ZvZ+wYMraFue4HYrE4ttONKtsvruIRf6t9TBR0YvSOfi1hUU0fJfBLCDYow==
|
||||
|
||||
"@types/cookie@^0.3.3":
|
||||
version "0.3.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.3.3.tgz#85bc74ba782fb7aa3a514d11767832b0e3bc6803"
|
||||
integrity sha512-LKVP3cgXBT9RYj+t+9FDKwS5tdI+rPBXaNSkma7hvqy35lc7mAokC2zsqWJH0LaqIt3B962nuYI77hsJoT1gow==
|
||||
|
||||
"@types/hoist-non-react-statics@^3.0.1":
|
||||
version "3.3.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f"
|
||||
integrity sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==
|
||||
dependencies:
|
||||
"@types/react" "*"
|
||||
hoist-non-react-statics "^3.3.0"
|
||||
|
||||
"@types/http-proxy@^1.17.5":
|
||||
version "1.17.7"
|
||||
resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.7.tgz#30ea85cc2c868368352a37f0d0d3581e24834c6f"
|
||||
@ -2758,6 +2771,11 @@ convert-source-map@^1.1.0, convert-source-map@^1.7.0:
|
||||
dependencies:
|
||||
safe-buffer "~5.1.1"
|
||||
|
||||
cookie@^0.4.0:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1"
|
||||
integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==
|
||||
|
||||
copy-descriptor@^0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
|
||||
@ -4115,7 +4133,7 @@ hmac-drbg@^1.0.1:
|
||||
minimalistic-assert "^1.0.0"
|
||||
minimalistic-crypto-utils "^1.0.1"
|
||||
|
||||
hoist-non-react-statics@^3.3.2:
|
||||
hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.2:
|
||||
version "3.3.2"
|
||||
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
|
||||
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
|
||||
@ -6255,6 +6273,15 @@ range-parser@1.2.0:
|
||||
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e"
|
||||
integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=
|
||||
|
||||
react-cookie@^4.1.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/react-cookie/-/react-cookie-4.1.1.tgz#832e134ad720e0de3e03deaceaab179c4061a19d"
|
||||
integrity sha512-ffn7Y7G4bXiFbnE+dKhHhbP+b8I34mH9jqnm8Llhj89zF4nPxPutxHT1suUqMeCEhLDBI7InYwf1tpaSoK5w8A==
|
||||
dependencies:
|
||||
"@types/hoist-non-react-statics" "^3.0.1"
|
||||
hoist-non-react-statics "^3.0.0"
|
||||
universal-cookie "^4.0.0"
|
||||
|
||||
react-dom@^17.0.2:
|
||||
version "17.0.2"
|
||||
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23"
|
||||
@ -7344,6 +7371,14 @@ uniqs@^2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02"
|
||||
integrity sha1-/+3ks2slKQaW5uFl1KWe25mOawI=
|
||||
|
||||
universal-cookie@^4.0.0:
|
||||
version "4.0.4"
|
||||
resolved "https://registry.yarnpkg.com/universal-cookie/-/universal-cookie-4.0.4.tgz#06e8b3625bf9af049569ef97109b4bb226ad798d"
|
||||
integrity sha512-lbRVHoOMtItjWbM7TwDLdl8wug7izB0tq3/YVKhT/ahB4VDvWMyvnADfnJI8y6fSvsjh51Ix7lTGC6Tn4rMPhw==
|
||||
dependencies:
|
||||
"@types/cookie" "^0.3.3"
|
||||
cookie "^0.4.0"
|
||||
|
||||
unpipe@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user