@liveblocks/node
Advanced tools
Comparing version 1.1.0-fsm1 to 1.1.0-fsm2
@@ -38,27 +38,31 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var __async = (__this, __arguments, generator) => { | ||
} | ||
const result = yield _nodefetch2.default.call(void 0, | ||
buildLiveblocksAuthorizeEndpoint(options, room), | ||
{ | ||
method: "POST", | ||
headers: { | ||
Authorization: `Bearer ${secret}`, | ||
"Content-Type": "application/json" | ||
}, | ||
body: JSON.stringify({ | ||
userId, | ||
userInfo, | ||
groupIds | ||
}) | ||
} | ||
); | ||
if (!result.ok) { | ||
const resp = yield _nodefetch2.default.call(void 0, buildLiveblocksAuthorizeEndpoint(options, room), { | ||
method: "POST", | ||
headers: { | ||
Authorization: `Bearer ${secret}`, | ||
"Content-Type": "application/json" | ||
}, | ||
body: JSON.stringify({ | ||
userId, | ||
userInfo, | ||
groupIds | ||
}) | ||
}); | ||
if (resp.ok) { | ||
return { | ||
status: 200, | ||
body: yield resp.text() | ||
}; | ||
} | ||
if (resp.status >= 500) { | ||
return { | ||
status: 503, | ||
body: yield resp.text() | ||
}; | ||
} else { | ||
return { | ||
status: 403, | ||
body: yield result.text() | ||
body: yield resp.text() | ||
}; | ||
} | ||
return { | ||
status: 200, | ||
body: yield result.text() | ||
}; | ||
} catch (er) { | ||
@@ -65,0 +69,0 @@ return { |
{ | ||
"name": "@liveblocks/node", | ||
"version": "1.1.0-fsm1", | ||
"version": "1.1.0-fsm2", | ||
"description": "A server-side utility that lets you set up a Liveblocks authentication endpoint. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
16001
382