Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(invite): move JWT to Authorization header for invite and search endpoints (#14777)

Aaron van Meerten9af0003c639d
diff --git a/react/features/invite/functions.ts b/react/features/invite/functions.ts
index 535eea14e3..44147ba3a6 100644
--- a/react/features/invite/functions.ts
+++ b/react/features/invite/functions.ts
@@ -427,17 +427,20 @@ export function invitePeopleAndChatRooms(
return Promise.resolve();
}
+ const headers = {
+ ...jwt ? { 'Authorization': `Bearer ${jwt}` } : {},
+ 'Content-Type': 'application/json'
+ };
+
return fetch(
- `${inviteServiceUrl}?token=${jwt}`,
+ `${inviteServiceUrl}`,
{
body: JSON.stringify({
'invited': inviteItems,
'url': inviteUrl
}),
method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- }
+ headers
}
);
}
@@ -544,8 +547,16 @@ export function searchDirectory( // eslint-disable-line max-params
const query = encodeURIComponent(text);
const queryTypesString = encodeURIComponent(JSON.stringify(queryTypes));
+ const headers = {
+ ...jwt ? { 'Authorization': `Bearer ${jwt}` } : {}
+ };
+
return fetch(`${serviceUrl}?query=${query}&queryTypes=${
- queryTypesString}&jwt=${jwt}`)
+ queryTypesString}`,
+ {
+ method: 'GET',
+ headers
+ })
.then(response => {
const jsonify = response.json();