ARCH - BIM AUTH: сервисный шлюз Tasker и подписанный просмотр вложений
This commit is contained in:
+16
-2
@@ -686,6 +686,7 @@ const hasModelSettingsTarget = () => !!getModelSettingsSrc(getPrimaryModelEntry(
|
||||
|
||||
const isGuestMode = () => viewerMode === "guest";
|
||||
const isGuestToolbarAction = (action) => GUEST_TOOLBAR_ACTIONS.has(action);
|
||||
const isTaskerEmbedMode = () => window.location.pathname === "/embed/tasker";
|
||||
|
||||
const getShareTokenFromPath = () => {
|
||||
const match = window.location.pathname.match(/^\/share\/([^/?#]+)/);
|
||||
@@ -2253,6 +2254,17 @@ const applyRuntimeMode = () => {
|
||||
};
|
||||
|
||||
const initializeRuntimeMode = async () => {
|
||||
if (isTaskerEmbedMode()) {
|
||||
viewerMode = "guest";
|
||||
runtimeSessionInfo = {
|
||||
authRequired: true,
|
||||
authenticated: false,
|
||||
canShare: false,
|
||||
user: null,
|
||||
};
|
||||
applyRuntimeMode();
|
||||
return;
|
||||
}
|
||||
const shareToken = getShareTokenFromPath();
|
||||
const shareGuestAuthMarker = hasShareGuestAuthMarker();
|
||||
if (shareToken) {
|
||||
@@ -5984,8 +5996,10 @@ const applyViewerState = (state) => {
|
||||
|
||||
const initViewer = async () => {
|
||||
await initializeRuntimeMode();
|
||||
setupNodeDCSessionSync();
|
||||
setupNodeDCSessionWatcher();
|
||||
if (!isTaskerEmbedMode()) {
|
||||
setupNodeDCSessionSync();
|
||||
setupNodeDCSessionWatcher();
|
||||
}
|
||||
|
||||
const sdk = await import(SDK_URL);
|
||||
sdkRef = sdk;
|
||||
|
||||
Reference in New Issue
Block a user