feat: Improve security of access tokens (#279)

Closes #275
This commit is contained in:
SimonTagne
2022-08-09 18:03:21 +02:00
committed by GitHub
parent dab38cbc18
commit 7786533a90
40 changed files with 273 additions and 133 deletions

View File

@@ -16,12 +16,13 @@ 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) =>
socket[method.toLowerCase()] = (url, data, headers) =>
new Promise((resolve, reject) => {
socket.request(
{
method,
data,
headers,
url: `/api${url}`,
},
(_, { body, error }) => {