feat: кнопка Выйти → /logout (OIDC) с предупреждением о SSO

- Возвращена кнопка в user.ejs, href=/logout вместо /v2/logout
- confirm() перед выходом: предупреждает что завершатся ВСЕ сессии Nubes
- /logout → destroy сессии Express → редирект на Keycloak OIDC logout

v0.1.10 → v0.1.11
This commit is contained in:
2026-07-02 08:38:29 +04:00
parent fc5aa7ca09
commit 7982a82286
3 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "ipwhitelist",
"version": "0.1.10",
"version": "0.1.11",
"description": "IP WhiteList microservice for cloud provider",
"main": "server.js",
"scripts": {
+1 -1
View File
@@ -8,7 +8,7 @@
// ═══════════════════════════════════════════════════════════════════════════════
module.exports = {
version: '0.1.10',
version: '0.1.11',
// ── IAM ──────────────────────────────────────────────────────────────────
iamUrl: process.env.V2_IAM_URL || 'https://auth-api.ngcloud.ru/api/v1/auth/user',
+3 -5
View File
@@ -124,11 +124,9 @@
<span style="margin-left:auto;display:flex;gap:.5rem;align-items:center;">
<span style="font-weight:500;color:var(--text);"><%= user.email %></span>
<!-- Кнопка выхода скрыта: /v2/logout не разлогинивает из Keycloak (только сессия Express).
Правильный OIDC-логаут с редиректом на KC — в src/routes/oidc.js:/logout.
Когда будет реализован полноценный SSO-логаут — раскомментировать.
<a href="/v2/logout" class="btn btn-sm">Выйти<% if (user.isImpersonated && user.originalUserEmail) { %> (<%= user.originalUserEmail %>)<% } %></a>
-->
<a href="/logout" class="btn btn-sm"
onclick="return confirm('Выход из whitelist завершит ВСЕ сессии Nubes (Keycloak SSO).\n\nПродолжить?')"
title="Выход из Keycloak (все сервисы Nubes)">Выйти<% if (user.isImpersonated && user.originalUserEmail) { %> (<%= user.originalUserEmail %>)<% } %></a>
</span>
</header>