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-ссылкам.",
|
||||
url: "https://bim.nodedc.tech",
|
||||
launchUrl: "https://bim.nodedc.tech",
|
||||
logoutUrl: "https://bim.nodedc.tech/logout",
|
||||
accentColor: "#8FE3C8",
|
||||
fallbackGradient: "linear-gradient(132deg, rgba(143, 227, 200, 0.78), rgba(24, 70, 64, 0.9) 46%, #080B0F 84%)",
|
||||
status: "active",
|
||||
|
|
@ -2351,6 +2352,7 @@ function applyBimViewerServiceInvariants(data) {
|
|||
service.fullDescription = service.fullDescription || bimViewerService.fullDescription;
|
||||
service.url = service.url || bimViewerService.url;
|
||||
service.launchUrl = service.launchUrl || service.url || bimViewerService.launchUrl;
|
||||
service.logoutUrl = service.logoutUrl || bimViewerService.logoutUrl;
|
||||
service.accentColor = service.accentColor || bimViewerService.accentColor;
|
||||
service.fallbackGradient = service.fallbackGradient || bimViewerService.fallbackGradient;
|
||||
service.status = service.status || bimViewerService.status;
|
||||
|
|
@ -2488,6 +2490,20 @@ function upsertSystemProtectedUserGrant(data, user, service, appRole, now) {
|
|||
|
||||
function normalizeService(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;
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ app.get("/auth/logged-out", (req, res) => {
|
|||
res.clearCookie(sessionCookieName, clearCookieOptions());
|
||||
res.clearCookie(oidcStateCookieName, clearCookieOptions());
|
||||
setNoStore(res);
|
||||
res.redirect(buildLoginRedirectUrl(returnTo, { forceLogin: true }));
|
||||
res.redirect(buildLoginRedirectUrl(returnTo, { includeReturnTo: returnTo !== "/" }));
|
||||
});
|
||||
|
||||
app.get("/auth/session-sync", (req, res) => {
|
||||
|
|
@ -3110,7 +3110,7 @@ function getBimViewerBaseUrl(app = null) {
|
|||
app?.launchTargetUrl ||
|
||||
app?.openUrl ||
|
||||
app?.url ||
|
||||
"http://localhost:8080"
|
||||
"https://bim.nodedc.tech"
|
||||
).replace(/\/$/, "");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ export function LauncherApp() {
|
|||
if (isRedirecting) return;
|
||||
|
||||
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-ссылкам.",
|
||||
url: "https://bim.nodedc.tech",
|
||||
launchUrl: "https://bim.nodedc.tech",
|
||||
logoutUrl: "https://bim.nodedc.tech/logout",
|
||||
accentColor: "#8FE3C8",
|
||||
fallbackGradient: "linear-gradient(132deg, rgba(143, 227, 200, 0.78), rgba(24, 70, 64, 0.9) 46%, #080B0F 84%)",
|
||||
status: "active",
|
||||
|
|
|
|||
Loading…
Reference in New Issue