feat: Store accessToken in cookies instead of localStorage

This commit is contained in:
Maksim Eltyshev
2022-04-26 18:01:55 +05:00
parent 536064fdfe
commit 486e663a3d
27 changed files with 137 additions and 114 deletions

View File

@@ -16,13 +16,12 @@ const { socket } = io;
socket.connect = socket._connect; // eslint-disable-line no-underscore-dangle
['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].forEach((method) => {
socket[method.toLowerCase()] = (url, data, headers) =>
socket[method.toLowerCase()] = (url, data) =>
new Promise((resolve, reject) => {
socket.request(
{
method,
data,
headers,
url: `/api${url}`,
},
(_, { body, error }) => {