mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 20:45:00 +02:00
Check user token in love service (#9464)
Signed-off-by: Anton Alexeyev <alexeyev.anton@gmail.com>
This commit is contained in:
@@ -113,9 +113,11 @@ export async function getToken (
|
||||
if (endpoint === undefined) {
|
||||
throw new Error('Love service endpoint not found')
|
||||
}
|
||||
const token = getPlatformToken()
|
||||
const res = await fetch(concatLink(endpoint, '/getToken'), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`,
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({ roomName: getTokenRoomName(roomName, roomId), _id: userId, participantName })
|
||||
@@ -553,7 +555,7 @@ async function withRetries (fn: () => Promise<void>, retries: number, delay: num
|
||||
|
||||
async function connect (name: string, room: Room, _id: string): Promise<void> {
|
||||
const wsURL = getMetadata(love.metadata.WebSocketURL)
|
||||
if (wsURL === undefined) {
|
||||
if (wsURL === undefined || getCurrentAccount().role === AccountRole.ReadOnlyGuest) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user