ФУНКЦИИ - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: Plane live access и logout handoff

This commit is contained in:
DCCONSTRUCTIONS
2026-05-04 18:54:21 +03:00
parent 55318f14e5
commit 3b13e5be52
15 changed files with 435 additions and 36 deletions
@@ -0,0 +1,27 @@
import { useEffect } from "react";
import { buildNodeDCOIDCLoginUrl, buildNodeDCLauncherUrl, sanitizeNextPath } from "@/helpers/nodedc-auth";
export function NodeDCAuthRedirect() {
useEffect(() => {
const currentUrl = new URL(window.location.href);
const oidcError = currentUrl.searchParams.get("error");
const nextPath = sanitizeNextPath(currentUrl.searchParams.get("next_path") || window.location.pathname);
if (oidcError === "oidc_access_denied" || oidcError === "nodedc_access_revoked") {
window.location.replace(buildNodeDCLauncherUrl());
return;
}
window.location.replace(buildNodeDCOIDCLoginUrl(nextPath));
}, []);
return (
<div className="relative z-10 flex h-screen w-screen flex-col items-center justify-center overflow-hidden bg-canvas px-8 py-12">
<div className="nodedc-auth-shell flex w-full max-w-[28rem] flex-col gap-4 text-center">
<div className="text-2xl font-semibold text-custom-text-100">Переходим в NODE.DC</div>
<div className="text-sm text-custom-text-300">Проверяем платформенную сессию и доступ к рабочему пространству.</div>
</div>
</div>
);
}