Register BIM logout in platform session flow
This commit is contained in:
parent
754142b2ca
commit
34ffa8ca4d
|
|
@ -73,6 +73,7 @@ const bimViewerService = {
|
||||||
"Standalone BIM/CAD viewer NODE.DC для рабочих моделей, вложений Operational Core, персонального модельного хранилища и безопасного внешнего просмотра по share-ссылкам.",
|
"Standalone BIM/CAD viewer NODE.DC для рабочих моделей, вложений Operational Core, персонального модельного хранилища и безопасного внешнего просмотра по share-ссылкам.",
|
||||||
url: "https://bim.nodedc.tech",
|
url: "https://bim.nodedc.tech",
|
||||||
launchUrl: "https://bim.nodedc.tech",
|
launchUrl: "https://bim.nodedc.tech",
|
||||||
|
logoutUrl: "https://bim.nodedc.tech/logout",
|
||||||
accentColor: "#8FE3C8",
|
accentColor: "#8FE3C8",
|
||||||
fallbackGradient: "linear-gradient(132deg, rgba(143, 227, 200, 0.78), rgba(24, 70, 64, 0.9) 46%, #080B0F 84%)",
|
fallbackGradient: "linear-gradient(132deg, rgba(143, 227, 200, 0.78), rgba(24, 70, 64, 0.9) 46%, #080B0F 84%)",
|
||||||
status: "active",
|
status: "active",
|
||||||
|
|
@ -2351,6 +2352,7 @@ function applyBimViewerServiceInvariants(data) {
|
||||||
service.fullDescription = service.fullDescription || bimViewerService.fullDescription;
|
service.fullDescription = service.fullDescription || bimViewerService.fullDescription;
|
||||||
service.url = service.url || bimViewerService.url;
|
service.url = service.url || bimViewerService.url;
|
||||||
service.launchUrl = service.launchUrl || service.url || bimViewerService.launchUrl;
|
service.launchUrl = service.launchUrl || service.url || bimViewerService.launchUrl;
|
||||||
|
service.logoutUrl = service.logoutUrl || bimViewerService.logoutUrl;
|
||||||
service.accentColor = service.accentColor || bimViewerService.accentColor;
|
service.accentColor = service.accentColor || bimViewerService.accentColor;
|
||||||
service.fallbackGradient = service.fallbackGradient || bimViewerService.fallbackGradient;
|
service.fallbackGradient = service.fallbackGradient || bimViewerService.fallbackGradient;
|
||||||
service.status = service.status || bimViewerService.status;
|
service.status = service.status || bimViewerService.status;
|
||||||
|
|
@ -2488,6 +2490,20 @@ function upsertSystemProtectedUserGrant(data, user, service, appRole, now) {
|
||||||
|
|
||||||
function normalizeService(service) {
|
function normalizeService(service) {
|
||||||
if (typeof service !== "object" || service === null) return service;
|
if (typeof service !== "object" || service === null) return service;
|
||||||
|
if (service.id === "service_bim_viewer" || service.slug === "bim-viewer" || service.authentikApplicationSlug === "bim-viewer") {
|
||||||
|
const legacyLocalUrl = (value) => value === "http://localhost:8080" || value === "http://127.0.0.1:8080";
|
||||||
|
return {
|
||||||
|
...service,
|
||||||
|
url: !service.url || legacyLocalUrl(service.url) ? "https://bim.nodedc.tech" : service.url,
|
||||||
|
launchUrl:
|
||||||
|
!service.launchUrl || legacyLocalUrl(service.launchUrl)
|
||||||
|
? "https://bim.nodedc.tech"
|
||||||
|
: service.launchUrl,
|
||||||
|
logoutUrl: service.logoutUrl || "https://bim.nodedc.tech/logout",
|
||||||
|
authentikApplicationSlug: service.authentikApplicationSlug || "bim-viewer",
|
||||||
|
authentikGroupName: service.authentikGroupName || "nodedc:bim:access",
|
||||||
|
};
|
||||||
|
}
|
||||||
if (service.id !== "service_nodedc" && service.slug !== "nodedc" && service.authentikApplicationSlug !== "nodedc") return service;
|
if (service.id !== "service_nodedc" && service.slug !== "nodedc" && service.authentikApplicationSlug !== "nodedc") return service;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,7 @@ app.get("/auth/logged-out", (req, res) => {
|
||||||
res.clearCookie(sessionCookieName, clearCookieOptions());
|
res.clearCookie(sessionCookieName, clearCookieOptions());
|
||||||
res.clearCookie(oidcStateCookieName, clearCookieOptions());
|
res.clearCookie(oidcStateCookieName, clearCookieOptions());
|
||||||
setNoStore(res);
|
setNoStore(res);
|
||||||
res.redirect(buildLoginRedirectUrl(returnTo, { forceLogin: true }));
|
res.redirect(buildLoginRedirectUrl(returnTo, { includeReturnTo: returnTo !== "/" }));
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/auth/session-sync", (req, res) => {
|
app.get("/auth/session-sync", (req, res) => {
|
||||||
|
|
@ -3110,7 +3110,7 @@ function getBimViewerBaseUrl(app = null) {
|
||||||
app?.launchTargetUrl ||
|
app?.launchTargetUrl ||
|
||||||
app?.openUrl ||
|
app?.openUrl ||
|
||||||
app?.url ||
|
app?.url ||
|
||||||
"http://localhost:8080"
|
"https://bim.nodedc.tech"
|
||||||
).replace(/\/$/, "");
|
).replace(/\/$/, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -339,7 +339,7 @@ export function LauncherApp() {
|
||||||
if (isRedirecting) return;
|
if (isRedirecting) return;
|
||||||
|
|
||||||
isRedirecting = true;
|
isRedirecting = true;
|
||||||
redirectToLogin("/auth/login?prompt=login");
|
redirectToLogin("/auth/login");
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,7 @@ export const mockServices: Service[] = [
|
||||||
"Standalone BIM/CAD viewer NODE.DC для рабочих моделей, вложений Operational Core, персонального модельного хранилища и безопасного внешнего просмотра по share-ссылкам.",
|
"Standalone BIM/CAD viewer NODE.DC для рабочих моделей, вложений Operational Core, персонального модельного хранилища и безопасного внешнего просмотра по share-ссылкам.",
|
||||||
url: "https://bim.nodedc.tech",
|
url: "https://bim.nodedc.tech",
|
||||||
launchUrl: "https://bim.nodedc.tech",
|
launchUrl: "https://bim.nodedc.tech",
|
||||||
|
logoutUrl: "https://bim.nodedc.tech/logout",
|
||||||
accentColor: "#8FE3C8",
|
accentColor: "#8FE3C8",
|
||||||
fallbackGradient: "linear-gradient(132deg, rgba(143, 227, 200, 0.78), rgba(24, 70, 64, 0.9) 46%, #080B0F 84%)",
|
fallbackGradient: "linear-gradient(132deg, rgba(143, 227, 200, 0.78), rgba(24, 70, 64, 0.9) 46%, #080B0F 84%)",
|
||||||
status: "active",
|
status: "active",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue