Promote authenticated BIM share viewers
This commit is contained in:
+7
-2
@@ -1531,10 +1531,15 @@ const handleGetShare = async (req, res, token) => {
|
||||
sendText(res, 404, "Share not found");
|
||||
return;
|
||||
}
|
||||
const session = getCurrentBimSession(req);
|
||||
const authenticated = !!session;
|
||||
sendJSON(res, 200, {
|
||||
ok: true,
|
||||
mode: "guest",
|
||||
readonly: true,
|
||||
mode: authenticated ? "standard" : "guest",
|
||||
readonly: !authenticated,
|
||||
authenticated,
|
||||
canShare: !BIM_AUTH_REQUIRED || authenticated,
|
||||
user: session?.user || null,
|
||||
viewer: {
|
||||
src: publicUrlForUploadSrc(req, share.src),
|
||||
settingsSrc: publicUrlForUploadSrc(req, share.settingsSrc || share.src),
|
||||
|
||||
Reference in New Issue
Block a user